| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <template>
- <button
- class="playful-btn"
- :class="['playful-btn--' + variant, 'playful-btn--' + size]"
- :disabled="disabled"
- @click="emitClick"
- :aria-label="ariaLabel"
- >
- <slot></slot>
- </button>
- </template>
- <script>
- export default {
- name: 'PlayfulButton',
- props: {
- variant: { type: String, default: 'primary' }, // 'primary' | 'secondary'
- size: { type: String, default: 'md' }, // 'sm' | 'md' | 'lg'
- disabled: { type: Boolean, default: false },
- ariaLabel: { type: String, default: '' }
- },
- methods: {
- emitClick(e) {
- if (!this.disabled) this.$emit('click', e);
- }
- }
- }
- </script>
- <style scoped>
- .playful-btn {
- border: none;
- border-radius: 999px;
- padding: 0.6rem 1rem;
- font-weight: 700;
- cursor: pointer;
- transition: transform .15s ease, box-shadow .15s ease;
- }
- .playful-btn--primary {
- background: var(--color-primary, #0EA5E9);
- color: #fff;
- box-shadow: 0 2px 6px rgba(14,165,233,.3);
- }
- .playful-btn--secondary {
- background: #f8fafc;
- color: var(--text, #1f2937);
- border: 1px solid var(--border, #e5e7eb);
- }
- .playful-btn--sm { font-size: 0.875rem; padding: 0.5rem 0.75rem; }
- .playful-btn--md { font-size: 1rem; padding: 0.6rem 1rem; }
- .playful-btn--lg { font-size: 1.125rem; padding: 0.75rem 1.25rem; }
- .playful-btn:active { transform: translateY(1px) scale(0.98); }
- .playful-btn:focus { outline: 2px solid rgba(14,165,233,.6); outline-offset: 2px; }
- </style>
|