@marwes-ui/svelte 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/LICENSE +21 -0
- package/README.md +518 -0
- package/dist/components/accordion/Accordion.svelte +56 -0
- package/dist/components/accordion/Accordion.svelte.d.ts +4 -0
- package/dist/components/accordion/AccordionField.svelte +90 -0
- package/dist/components/accordion/AccordionField.svelte.d.ts +4 -0
- package/dist/components/accordion/FAQAccordion.svelte +21 -0
- package/dist/components/accordion/FAQAccordion.svelte.d.ts +20 -0
- package/dist/components/accordion/README.md +19 -0
- package/dist/components/accordion/SectionsAccordion.svelte +22 -0
- package/dist/components/accordion/SectionsAccordion.svelte.d.ts +21 -0
- package/dist/components/accordion/SettingsAccordion.svelte +21 -0
- package/dist/components/accordion/SettingsAccordion.svelte.d.ts +20 -0
- package/dist/components/accordion/index.d.ts +2 -0
- package/dist/components/accordion/index.js +1 -0
- package/dist/components/accordion/types.d.ts +28 -0
- package/dist/components/accordion/types.js +1 -0
- package/dist/components/avatar/Avatar.svelte +45 -0
- package/dist/components/avatar/Avatar.svelte.d.ts +4 -0
- package/dist/components/avatar/AvatarBadge.svelte +47 -0
- package/dist/components/avatar/AvatarBadge.svelte.d.ts +7 -0
- package/dist/components/avatar/AvatarGroup.svelte +50 -0
- package/dist/components/avatar/AvatarGroup.svelte.d.ts +15 -0
- package/dist/components/avatar/PresenceAvatar.svelte +12 -0
- package/dist/components/avatar/PresenceAvatar.svelte.d.ts +7 -0
- package/dist/components/avatar/ProfileAvatar.svelte +7 -0
- package/dist/components/avatar/ProfileAvatar.svelte.d.ts +4 -0
- package/dist/components/avatar/README.md +19 -0
- package/dist/components/avatar/TeamAvatarGroup.svelte +21 -0
- package/dist/components/avatar/TeamAvatarGroup.svelte.d.ts +15 -0
- package/dist/components/avatar/index.d.ts +2 -0
- package/dist/components/avatar/index.js +1 -0
- package/dist/components/avatar/types.d.ts +6 -0
- package/dist/components/avatar/types.js +1 -0
- package/dist/components/badge/Badge.svelte +26 -0
- package/dist/components/badge/Badge.svelte.d.ts +4 -0
- package/dist/components/badge/BadgeGroup.svelte +25 -0
- package/dist/components/badge/BadgeGroup.svelte.d.ts +4 -0
- package/dist/components/badge/NotificationBadge.svelte +7 -0
- package/dist/components/badge/NotificationBadge.svelte.d.ts +4 -0
- package/dist/components/badge/PriorityBadge.svelte +7 -0
- package/dist/components/badge/PriorityBadge.svelte.d.ts +4 -0
- package/dist/components/badge/README.md +16 -0
- package/dist/components/badge/StatusBadge.svelte +7 -0
- package/dist/components/badge/StatusBadge.svelte.d.ts +4 -0
- package/dist/components/badge/index.d.ts +3 -0
- package/dist/components/badge/index.js +2 -0
- package/dist/components/badge/types.d.ts +15 -0
- package/dist/components/badge/types.js +1 -0
- package/dist/components/button/Button.svelte +92 -0
- package/dist/components/button/Button.svelte.d.ts +4 -0
- package/dist/components/button/CancelButton.svelte +8 -0
- package/dist/components/button/CancelButton.svelte.d.ts +5 -0
- package/dist/components/button/CloseButton.svelte +8 -0
- package/dist/components/button/CloseButton.svelte.d.ts +5 -0
- package/dist/components/button/ConfirmButton.svelte +8 -0
- package/dist/components/button/ConfirmButton.svelte.d.ts +5 -0
- package/dist/components/button/CopyButton.svelte +8 -0
- package/dist/components/button/CopyButton.svelte.d.ts +5 -0
- package/dist/components/button/CreateButton.svelte +7 -0
- package/dist/components/button/CreateButton.svelte.d.ts +5 -0
- package/dist/components/button/DestructiveButton.svelte +8 -0
- package/dist/components/button/DestructiveButton.svelte.d.ts +5 -0
- package/dist/components/button/DownloadButton.svelte +8 -0
- package/dist/components/button/DownloadButton.svelte.d.ts +5 -0
- package/dist/components/button/DropdownButton.svelte +8 -0
- package/dist/components/button/DropdownButton.svelte.d.ts +5 -0
- package/dist/components/button/EditButton.svelte +8 -0
- package/dist/components/button/EditButton.svelte.d.ts +5 -0
- package/dist/components/button/FilterButton.svelte +8 -0
- package/dist/components/button/FilterButton.svelte.d.ts +5 -0
- package/dist/components/button/LinkButton.svelte +8 -0
- package/dist/components/button/LinkButton.svelte.d.ts +5 -0
- package/dist/components/button/PrimaryButton.svelte +7 -0
- package/dist/components/button/PrimaryButton.svelte.d.ts +5 -0
- package/dist/components/button/README.md +21 -0
- package/dist/components/button/RefreshButton.svelte +8 -0
- package/dist/components/button/RefreshButton.svelte.d.ts +5 -0
- package/dist/components/button/SaveButton.svelte +8 -0
- package/dist/components/button/SaveButton.svelte.d.ts +5 -0
- package/dist/components/button/SearchButton.svelte +8 -0
- package/dist/components/button/SearchButton.svelte.d.ts +5 -0
- package/dist/components/button/SecondaryButton.svelte +7 -0
- package/dist/components/button/SecondaryButton.svelte.d.ts +5 -0
- package/dist/components/button/SortButton.svelte +8 -0
- package/dist/components/button/SortButton.svelte.d.ts +5 -0
- package/dist/components/button/SubmitButton.svelte +7 -0
- package/dist/components/button/SubmitButton.svelte.d.ts +5 -0
- package/dist/components/button/SuccessButton.svelte +7 -0
- package/dist/components/button/SuccessButton.svelte.d.ts +5 -0
- package/dist/components/button/TextButton.svelte +7 -0
- package/dist/components/button/TextButton.svelte.d.ts +5 -0
- package/dist/components/button/UploadButton.svelte +8 -0
- package/dist/components/button/UploadButton.svelte.d.ts +5 -0
- package/dist/components/button/VerifyButton.svelte +8 -0
- package/dist/components/button/VerifyButton.svelte.d.ts +5 -0
- package/dist/components/button/index.d.ts +2 -0
- package/dist/components/button/index.js +1 -0
- package/dist/components/button/types.d.ts +8 -0
- package/dist/components/button/types.js +1 -0
- package/dist/components/card/Card.svelte +33 -0
- package/dist/components/card/Card.svelte.d.ts +4 -0
- package/dist/components/card/ProductCard.svelte +6 -0
- package/dist/components/card/ProductCard.svelte.d.ts +4 -0
- package/dist/components/card/ProfileCard.svelte +6 -0
- package/dist/components/card/ProfileCard.svelte.d.ts +4 -0
- package/dist/components/card/README.md +15 -0
- package/dist/components/card/StatCard.svelte +6 -0
- package/dist/components/card/StatCard.svelte.d.ts +4 -0
- package/dist/components/card/index.d.ts +2 -0
- package/dist/components/card/index.js +1 -0
- package/dist/components/card/types.d.ts +10 -0
- package/dist/components/card/types.js +1 -0
- package/dist/components/checkbox/Checkbox.svelte +54 -0
- package/dist/components/checkbox/Checkbox.svelte.d.ts +4 -0
- package/dist/components/checkbox/CheckboxField.svelte +74 -0
- package/dist/components/checkbox/CheckboxField.svelte.d.ts +4 -0
- package/dist/components/checkbox/CheckboxGroupField.svelte +50 -0
- package/dist/components/checkbox/CheckboxGroupField.svelte.d.ts +4 -0
- package/dist/components/checkbox/README.md +17 -0
- package/dist/components/checkbox/index.d.ts +3 -0
- package/dist/components/checkbox/index.js +2 -0
- package/dist/components/checkbox/types.d.ts +30 -0
- package/dist/components/checkbox/types.js +1 -0
- package/dist/components/date-picker/DatePicker.svelte +108 -0
- package/dist/components/date-picker/DatePicker.svelte.d.ts +4 -0
- package/dist/components/date-picker/README.md +17 -0
- package/dist/components/date-picker/index.d.ts +2 -0
- package/dist/components/date-picker/index.js +1 -0
- package/dist/components/date-picker/types.d.ts +13 -0
- package/dist/components/date-picker/types.js +1 -0
- package/dist/components/dialog/ConfirmDialog.svelte +28 -0
- package/dist/components/dialog/ConfirmDialog.svelte.d.ts +4 -0
- package/dist/components/dialog/DestructiveDialog.svelte +28 -0
- package/dist/components/dialog/DestructiveDialog.svelte.d.ts +4 -0
- package/dist/components/dialog/Dialog.svelte +114 -0
- package/dist/components/dialog/Dialog.svelte.d.ts +4 -0
- package/dist/components/dialog/DialogModal.svelte +120 -0
- package/dist/components/dialog/DialogModal.svelte.d.ts +4 -0
- package/dist/components/dialog/InfoDialog.svelte +24 -0
- package/dist/components/dialog/InfoDialog.svelte.d.ts +4 -0
- package/dist/components/dialog/README.md +23 -0
- package/dist/components/dialog/index.d.ts +6 -0
- package/dist/components/dialog/index.js +5 -0
- package/dist/components/dialog/types.d.ts +42 -0
- package/dist/components/dialog/types.js +1 -0
- package/dist/components/divider/Divider.svelte +25 -0
- package/dist/components/divider/Divider.svelte.d.ts +4 -0
- package/dist/components/divider/README.md +15 -0
- package/dist/components/divider/index.d.ts +2 -0
- package/dist/components/divider/index.js +1 -0
- package/dist/components/divider/types.d.ts +5 -0
- package/dist/components/divider/types.js +1 -0
- package/dist/components/heading/H1.svelte +23 -0
- package/dist/components/heading/H1.svelte.d.ts +4 -0
- package/dist/components/heading/H2.svelte +23 -0
- package/dist/components/heading/H2.svelte.d.ts +4 -0
- package/dist/components/heading/H3.svelte +23 -0
- package/dist/components/heading/H3.svelte.d.ts +4 -0
- package/dist/components/heading/README.md +13 -0
- package/dist/components/heading/index.d.ts +4 -0
- package/dist/components/heading/index.js +3 -0
- package/dist/components/heading/types.d.ts +26 -0
- package/dist/components/heading/types.js +1 -0
- package/dist/components/icon/Icon.svelte +65 -0
- package/dist/components/icon/Icon.svelte.d.ts +4 -0
- package/dist/components/icon/README.md +18 -0
- package/dist/components/icon/index.d.ts +2 -0
- package/dist/components/icon/index.js +1 -0
- package/dist/components/icon/types.d.ts +12 -0
- package/dist/components/icon/types.js +1 -0
- package/dist/components/input/CurrencyField.svelte +12 -0
- package/dist/components/input/CurrencyField.svelte.d.ts +7 -0
- package/dist/components/input/DateOfBirthField.svelte +21 -0
- package/dist/components/input/DateOfBirthField.svelte.d.ts +14 -0
- package/dist/components/input/DropdownField.svelte +29 -0
- package/dist/components/input/DropdownField.svelte.d.ts +14 -0
- package/dist/components/input/EmailField.svelte +9 -0
- package/dist/components/input/EmailField.svelte.d.ts +7 -0
- package/dist/components/input/Input.svelte +49 -0
- package/dist/components/input/Input.svelte.d.ts +4 -0
- package/dist/components/input/InputField.svelte +139 -0
- package/dist/components/input/InputField.svelte.d.ts +4 -0
- package/dist/components/input/InputOtp.svelte +140 -0
- package/dist/components/input/InputOtp.svelte.d.ts +4 -0
- package/dist/components/input/PasswordField.svelte +9 -0
- package/dist/components/input/PasswordField.svelte.d.ts +7 -0
- package/dist/components/input/PhoneField.svelte +9 -0
- package/dist/components/input/PhoneField.svelte.d.ts +7 -0
- package/dist/components/input/README.md +24 -0
- package/dist/components/input/RichText.svelte +177 -0
- package/dist/components/input/RichText.svelte.d.ts +4 -0
- package/dist/components/input/RichTextField.svelte +84 -0
- package/dist/components/input/RichTextField.svelte.d.ts +4 -0
- package/dist/components/input/SearchField.svelte +9 -0
- package/dist/components/input/SearchField.svelte.d.ts +7 -0
- package/dist/components/input/Select.svelte +88 -0
- package/dist/components/input/Select.svelte.d.ts +4 -0
- package/dist/components/input/SelectField.svelte +395 -0
- package/dist/components/input/SelectField.svelte.d.ts +4 -0
- package/dist/components/input/Textarea.svelte +50 -0
- package/dist/components/input/Textarea.svelte.d.ts +4 -0
- package/dist/components/input/TextareaField.svelte +57 -0
- package/dist/components/input/TextareaField.svelte.d.ts +4 -0
- package/dist/components/input/URLField.svelte +9 -0
- package/dist/components/input/URLField.svelte.d.ts +7 -0
- package/dist/components/input/ZipCodeField.svelte +21 -0
- package/dist/components/input/ZipCodeField.svelte.d.ts +14 -0
- package/dist/components/input/index.d.ts +7 -0
- package/dist/components/input/index.js +6 -0
- package/dist/components/input/types.d.ts +104 -0
- package/dist/components/input/types.js +1 -0
- package/dist/components/paragraph/Paragraph.svelte +23 -0
- package/dist/components/paragraph/Paragraph.svelte.d.ts +4 -0
- package/dist/components/paragraph/README.md +13 -0
- package/dist/components/paragraph/index.d.ts +2 -0
- package/dist/components/paragraph/index.js +1 -0
- package/dist/components/paragraph/types.d.ts +9 -0
- package/dist/components/paragraph/types.js +1 -0
- package/dist/components/radio/OptionRadioGroup.svelte +52 -0
- package/dist/components/radio/OptionRadioGroup.svelte.d.ts +21 -0
- package/dist/components/radio/README.md +16 -0
- package/dist/components/radio/Radio.svelte +38 -0
- package/dist/components/radio/Radio.svelte.d.ts +4 -0
- package/dist/components/radio/RadioGroupField.svelte +75 -0
- package/dist/components/radio/RadioGroupField.svelte.d.ts +4 -0
- package/dist/components/radio/RatingRadioGroup.svelte +51 -0
- package/dist/components/radio/RatingRadioGroup.svelte.d.ts +17 -0
- package/dist/components/radio/YesNoRadioGroup.svelte +48 -0
- package/dist/components/radio/YesNoRadioGroup.svelte.d.ts +16 -0
- package/dist/components/radio/index.d.ts +3 -0
- package/dist/components/radio/index.js +2 -0
- package/dist/components/radio/types.d.ts +22 -0
- package/dist/components/radio/types.js +1 -0
- package/dist/components/skeleton/README.md +16 -0
- package/dist/components/skeleton/Skeleton.svelte +29 -0
- package/dist/components/skeleton/Skeleton.svelte.d.ts +4 -0
- package/dist/components/skeleton/index.d.ts +2 -0
- package/dist/components/skeleton/index.js +1 -0
- package/dist/components/skeleton/types.d.ts +6 -0
- package/dist/components/skeleton/types.js +1 -0
- package/dist/components/slider/BrightnessSlider.svelte +31 -0
- package/dist/components/slider/BrightnessSlider.svelte.d.ts +11 -0
- package/dist/components/slider/README.md +20 -0
- package/dist/components/slider/RadiusSlider.svelte +31 -0
- package/dist/components/slider/RadiusSlider.svelte.d.ts +11 -0
- package/dist/components/slider/Slider.svelte +67 -0
- package/dist/components/slider/Slider.svelte.d.ts +4 -0
- package/dist/components/slider/SliderField.svelte +115 -0
- package/dist/components/slider/SliderField.svelte.d.ts +4 -0
- package/dist/components/slider/VolumeSlider.svelte +31 -0
- package/dist/components/slider/VolumeSlider.svelte.d.ts +11 -0
- package/dist/components/slider/index.d.ts +2 -0
- package/dist/components/slider/index.js +1 -0
- package/dist/components/slider/types.d.ts +28 -0
- package/dist/components/slider/types.js +1 -0
- package/dist/components/spacing/README.md +15 -0
- package/dist/components/spacing/Spacer.svelte +8 -0
- package/dist/components/spacing/Spacer.svelte.d.ts +3 -0
- package/dist/components/spacing/Spacing.svelte +23 -0
- package/dist/components/spacing/Spacing.svelte.d.ts +4 -0
- package/dist/components/spacing/index.d.ts +3 -0
- package/dist/components/spacing/index.js +2 -0
- package/dist/components/spacing/types.d.ts +7 -0
- package/dist/components/spacing/types.js +1 -0
- package/dist/components/spinner/ButtonSpinner.svelte +35 -0
- package/dist/components/spinner/ButtonSpinner.svelte.d.ts +4 -0
- package/dist/components/spinner/EmptyStateSpinner.svelte +20 -0
- package/dist/components/spinner/EmptyStateSpinner.svelte.d.ts +4 -0
- package/dist/components/spinner/README.md +19 -0
- package/dist/components/spinner/Spinner.svelte +60 -0
- package/dist/components/spinner/Spinner.svelte.d.ts +4 -0
- package/dist/components/spinner/index.d.ts +3 -0
- package/dist/components/spinner/index.js +2 -0
- package/dist/components/spinner/types.d.ts +9 -0
- package/dist/components/spinner/types.js +1 -0
- package/dist/components/stat-tile/README.md +15 -0
- package/dist/components/stat-tile/StatTile.svelte +44 -0
- package/dist/components/stat-tile/StatTile.svelte.d.ts +4 -0
- package/dist/components/stat-tile/index.d.ts +2 -0
- package/dist/components/stat-tile/index.js +1 -0
- package/dist/components/stat-tile/types.d.ts +14 -0
- package/dist/components/stat-tile/types.js +1 -0
- package/dist/components/switch/FeatureToggle.svelte +19 -0
- package/dist/components/switch/FeatureToggle.svelte.d.ts +13 -0
- package/dist/components/switch/PermissionSwitch.svelte +19 -0
- package/dist/components/switch/PermissionSwitch.svelte.d.ts +13 -0
- package/dist/components/switch/PreferenceSwitch.svelte +19 -0
- package/dist/components/switch/PreferenceSwitch.svelte.d.ts +13 -0
- package/dist/components/switch/README.md +17 -0
- package/dist/components/switch/Switch.svelte +52 -0
- package/dist/components/switch/Switch.svelte.d.ts +4 -0
- package/dist/components/switch/SwitchField.svelte +71 -0
- package/dist/components/switch/SwitchField.svelte.d.ts +4 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.js +2 -0
- package/dist/components/switch/types.d.ts +20 -0
- package/dist/components/switch/types.js +1 -0
- package/dist/components/tab/ContentTabs.svelte +11 -0
- package/dist/components/tab/ContentTabs.svelte.d.ts +3 -0
- package/dist/components/tab/NavigationTabs.svelte +11 -0
- package/dist/components/tab/NavigationTabs.svelte.d.ts +3 -0
- package/dist/components/tab/README.md +26 -0
- package/dist/components/tab/SettingsTabs.svelte +11 -0
- package/dist/components/tab/SettingsTabs.svelte.d.ts +3 -0
- package/dist/components/tab/Tab.svelte +32 -0
- package/dist/components/tab/Tab.svelte.d.ts +4 -0
- package/dist/components/tab/TabGroup.svelte +132 -0
- package/dist/components/tab/TabGroup.svelte.d.ts +4 -0
- package/dist/components/tab/TabPanel.svelte +25 -0
- package/dist/components/tab/TabPanel.svelte.d.ts +4 -0
- package/dist/components/tab/index.d.ts +7 -0
- package/dist/components/tab/index.js +6 -0
- package/dist/components/tab/types.d.ts +36 -0
- package/dist/components/tab/types.js +1 -0
- package/dist/components/toast/ErrorToast.svelte +24 -0
- package/dist/components/toast/ErrorToast.svelte.d.ts +4 -0
- package/dist/components/toast/InfoToast.svelte +24 -0
- package/dist/components/toast/InfoToast.svelte.d.ts +4 -0
- package/dist/components/toast/README.md +35 -0
- package/dist/components/toast/SuccessToast.svelte +25 -0
- package/dist/components/toast/SuccessToast.svelte.d.ts +4 -0
- package/dist/components/toast/Toast.svelte +53 -0
- package/dist/components/toast/Toast.svelte.d.ts +4 -0
- package/dist/components/toast/ToastContainer.svelte +212 -0
- package/dist/components/toast/ToastContainer.svelte.d.ts +4 -0
- package/dist/components/toast/ToastProvider.svelte +71 -0
- package/dist/components/toast/ToastProvider.svelte.d.ts +7 -0
- package/dist/components/toast/WarningToast.svelte +24 -0
- package/dist/components/toast/WarningToast.svelte.d.ts +4 -0
- package/dist/components/toast/index.d.ts +9 -0
- package/dist/components/toast/index.js +8 -0
- package/dist/components/toast/types.d.ts +48 -0
- package/dist/components/toast/types.js +1 -0
- package/dist/components/tooltip/README.md +22 -0
- package/dist/components/tooltip/Tooltip.svelte +29 -0
- package/dist/components/tooltip/Tooltip.svelte.d.ts +4 -0
- package/dist/components/tooltip/TooltipGroup.svelte +100 -0
- package/dist/components/tooltip/TooltipGroup.svelte.d.ts +4 -0
- package/dist/components/tooltip/index.d.ts +3 -0
- package/dist/components/tooltip/index.js +2 -0
- package/dist/components/tooltip/types.d.ts +22 -0
- package/dist/components/tooltip/types.js +1 -0
- package/dist/index.d.ts +149 -0
- package/dist/index.js +149 -0
- package/dist/internal/attrs.d.ts +2 -0
- package/dist/internal/attrs.js +5 -0
- package/dist/internal/css-vars.d.ts +5 -0
- package/dist/internal/css-vars.js +20 -0
- package/dist/internal/merge-class.d.ts +1 -0
- package/dist/internal/merge-class.js +4 -0
- package/dist/internal/svg-attrs.d.ts +9 -0
- package/dist/internal/svg-attrs.js +16 -0
- package/dist/provider/MarwesProvider.svelte +186 -0
- package/dist/provider/MarwesProvider.svelte.d.ts +4 -0
- package/dist/provider/context.d.ts +3 -0
- package/dist/provider/context.js +12 -0
- package/dist/provider/runtime-theme.d.ts +5 -0
- package/dist/provider/runtime-theme.js +63 -0
- package/dist/provider/theme-mode-runtime.d.ts +15 -0
- package/dist/provider/theme-mode-runtime.js +84 -0
- package/dist/provider/types.d.ts +32 -0
- package/dist/provider/types.js +1 -0
- package/dist/provider/use-theme-mode.d.ts +24 -0
- package/dist/provider/use-theme-mode.js +38 -0
- package/dist/provider/use-theme.d.ts +15 -0
- package/dist/provider/use-theme.js +19 -0
- package/dist/ssr.d.ts +2 -0
- package/dist/ssr.js +1 -0
- package/package.json +59 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Badge from "./Badge.svelte";
|
|
4
|
+
import type { BadgeProps } from "./types.js";
|
|
5
|
+
let { dataAttributes, ...props }: BadgeProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
<Badge {...props} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("priority") }} />
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Badge — Parity Findings
|
|
2
|
+
|
|
3
|
+
## Svelte vs React/Vue
|
|
4
|
+
|
|
5
|
+
### Aligned ✅
|
|
6
|
+
- `Badge` atom with `createBadgeRecipe`
|
|
7
|
+
- All variants: neutral, info, success, warning, error
|
|
8
|
+
- `BadgeGroup` molecule with fieldset/legend/aria-labelledby
|
|
9
|
+
- Class merging, data attributes spreading
|
|
10
|
+
- Optional ariaLabel, id, custom dataAttributes
|
|
11
|
+
|
|
12
|
+
### Missing ❌
|
|
13
|
+
- **Purpose variant wrappers** (3): `StatusBadge`, `PriorityBadge`, `NotificationBadge`
|
|
14
|
+
|
|
15
|
+
### Notes
|
|
16
|
+
- Purpose badge variants are thin — they pre-set variant and add purpose-specific data attributes. Low priority follow-up.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Badge from "./Badge.svelte";
|
|
4
|
+
import type { BadgeProps } from "./types.js";
|
|
5
|
+
let { dataAttributes, ...props }: BadgeProps = $props();
|
|
6
|
+
</script>
|
|
7
|
+
<Badge {...props} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("status") }} />
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BadgeOptions } from "@marwes-ui/core";
|
|
2
|
+
import type { Snippet } from "svelte";
|
|
3
|
+
export interface BadgeProps extends BadgeOptions {
|
|
4
|
+
children?: Snippet;
|
|
5
|
+
class?: string;
|
|
6
|
+
id?: string;
|
|
7
|
+
dataAttributes?: Record<string, string>;
|
|
8
|
+
}
|
|
9
|
+
export interface BadgeGroupProps {
|
|
10
|
+
/** Visible label for the badge group. */
|
|
11
|
+
label: string;
|
|
12
|
+
children?: Snippet;
|
|
13
|
+
class?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { type ButtonVariant, createButtonRecipe } from "@marwes-ui/core";
|
|
3
|
+
import { cssVarsToStyle, mergeStyle } from "../../internal/css-vars.js";
|
|
4
|
+
import { mergeClass } from "../../internal/merge-class.js";
|
|
5
|
+
import Icon from "../icon/Icon.svelte";
|
|
6
|
+
import ButtonSpinner from "../spinner/ButtonSpinner.svelte";
|
|
7
|
+
import type { ButtonProps } from "./types.js";
|
|
8
|
+
|
|
9
|
+
let {
|
|
10
|
+
children,
|
|
11
|
+
onclick,
|
|
12
|
+
class: className,
|
|
13
|
+
style,
|
|
14
|
+
...options
|
|
15
|
+
}: ButtonProps = $props();
|
|
16
|
+
|
|
17
|
+
const kit = $derived(createButtonRecipe(options));
|
|
18
|
+
const mergedClass = $derived(mergeClass(kit.className, className));
|
|
19
|
+
const mergedStyle = $derived(mergeStyle(cssVarsToStyle(kit.vars), style));
|
|
20
|
+
|
|
21
|
+
const resolvedVariant = $derived((options.variant ?? "primary") as ButtonVariant);
|
|
22
|
+
const isFilledVariant = $derived(resolvedVariant === "primary" || resolvedVariant === "success");
|
|
23
|
+
|
|
24
|
+
const visibleLabel = $derived(
|
|
25
|
+
kit.loading.isLoading && kit.loading.loadingLabel !== undefined
|
|
26
|
+
? kit.loading.loadingLabel
|
|
27
|
+
: undefined
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
function handleClick(e: MouseEvent): void {
|
|
31
|
+
if (kit.blockClick) {
|
|
32
|
+
e.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
onclick?.(e);
|
|
36
|
+
}
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
{#snippet buttonContent()}
|
|
40
|
+
{#if kit.loading.isLoading}
|
|
41
|
+
<ButtonSpinner variant={kit.loading.spinnerVariant} inverted={isFilledVariant} />
|
|
42
|
+
{:else if options.iconLeft}
|
|
43
|
+
<Icon name={options.iconLeft} size="xs" strokeWidth="sm" decorative />
|
|
44
|
+
{/if}
|
|
45
|
+
{#if visibleLabel}
|
|
46
|
+
{visibleLabel}
|
|
47
|
+
{:else}
|
|
48
|
+
{@render children?.()}
|
|
49
|
+
{/if}
|
|
50
|
+
{#if !kit.loading.isLoading && options.iconRight}
|
|
51
|
+
<Icon name={options.iconRight} size="xs" strokeWidth="sm" decorative />
|
|
52
|
+
{/if}
|
|
53
|
+
{/snippet}
|
|
54
|
+
|
|
55
|
+
{#if kit.tag === "button"}
|
|
56
|
+
<button
|
|
57
|
+
type={kit.a11y.type}
|
|
58
|
+
disabled={kit.a11y.disabled}
|
|
59
|
+
aria-label={kit.a11y.ariaLabel}
|
|
60
|
+
aria-busy={kit.a11y.ariaBusy}
|
|
61
|
+
aria-disabled={kit.a11y.ariaDisabled}
|
|
62
|
+
aria-pressed={kit.a11y.ariaPressed}
|
|
63
|
+
aria-expanded={kit.a11y.ariaExpanded}
|
|
64
|
+
aria-controls={kit.a11y.ariaControls}
|
|
65
|
+
title={kit.a11y.title}
|
|
66
|
+
class={mergedClass}
|
|
67
|
+
style={mergedStyle}
|
|
68
|
+
onclick={handleClick}
|
|
69
|
+
{...kit.dataAttributes}
|
|
70
|
+
>
|
|
71
|
+
{@render buttonContent()}
|
|
72
|
+
</button>
|
|
73
|
+
{:else}
|
|
74
|
+
<a
|
|
75
|
+
href={kit.a11y.href}
|
|
76
|
+
role={kit.a11y.role}
|
|
77
|
+
tabindex={kit.a11y.tabIndex}
|
|
78
|
+
aria-label={kit.a11y.ariaLabel}
|
|
79
|
+
aria-busy={kit.a11y.ariaBusy}
|
|
80
|
+
aria-disabled={kit.a11y.ariaDisabled}
|
|
81
|
+
aria-pressed={kit.a11y.ariaPressed}
|
|
82
|
+
aria-expanded={kit.a11y.ariaExpanded}
|
|
83
|
+
aria-controls={kit.a11y.ariaControls}
|
|
84
|
+
title={kit.a11y.title}
|
|
85
|
+
class={mergedClass}
|
|
86
|
+
style={mergedStyle}
|
|
87
|
+
onclick={handleClick}
|
|
88
|
+
{...kit.dataAttributes}
|
|
89
|
+
>
|
|
90
|
+
{@render buttonContent()}
|
|
91
|
+
</a>
|
|
92
|
+
{/if}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} action="cancel" variant={props.variant ?? "neutral"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("cancel"), "data-cancel": "true" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="neutral" action="cancel" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("close") }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="success" action="button" as="button" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("confirm") }} />
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ButtonProps } from "./types.js";
|
|
2
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
3
|
+
declare const ConfirmButton: import("svelte").Component<Props, {}, "">;
|
|
4
|
+
type ConfirmButton = ReturnType<typeof ConfirmButton>;
|
|
5
|
+
export default ConfirmButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="neutral" action="button" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("copy"), "data-copy": "true" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="primary" action="delete" error as="button" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("destructive") }} />
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ButtonProps } from "./types.js";
|
|
2
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
3
|
+
declare const DestructiveButton: import("svelte").Component<Props, {}, "">;
|
|
4
|
+
type DestructiveButton = ReturnType<typeof DestructiveButton>;
|
|
5
|
+
export default DestructiveButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="secondary" action="button" iconRight={props.iconRight ?? "download"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("download"), "data-transfer": "download" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="secondary" action="button" iconRight={props.iconRight ?? "chevronDown"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("dropdown"), "data-dropdown": "true" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="secondary" action="edit" iconRight={props.iconRight ?? "edit"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("edit") }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="neutral" action="button" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("filter"), "data-filter": "true" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="text" action="navigate" as="a" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("navigation") }} />
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Button — Parity Findings
|
|
2
|
+
|
|
3
|
+
## Svelte vs React/Vue
|
|
4
|
+
|
|
5
|
+
### Aligned ✅
|
|
6
|
+
- Base `Button` component with full `createButtonRecipe` integration
|
|
7
|
+
- All props: variant, size, action, disabled, loading, iconLeft, iconRight, href, as
|
|
8
|
+
- Anchor path (as="a") with href
|
|
9
|
+
- Loading state with `ButtonSpinner`
|
|
10
|
+
- Icon rendering via `Icon` component
|
|
11
|
+
- Class/style merging with core output
|
|
12
|
+
- All a11y attributes from core recipe
|
|
13
|
+
- Data attributes spreading
|
|
14
|
+
|
|
15
|
+
### Missing ❌
|
|
16
|
+
- **Purpose variant wrappers** (22 components): `PrimaryButton`, `SecondaryButton`, `TextButton`, `SuccessButton`, `DestructiveButton`, `CreateButton`, `SubmitButton`, `CancelButton`, `LinkButton`, `SaveButton`, `ConfirmButton`, `VerifyButton`, `EditButton`, `CloseButton`, `RefreshButton`, `UploadButton`, `DownloadButton`, `CopyButton`, `SearchButton`, `FilterButton`, `SortButton`, `DropdownButton`
|
|
17
|
+
- Dev-mode warnings for forbidden props on purpose variants
|
|
18
|
+
|
|
19
|
+
### Notes
|
|
20
|
+
- Purpose wrappers are thin — each just pre-sets `variant`, `action`, and optionally `iconLeft`/`iconRight` via the core `createPurposeSemanticAttributes`. Can be added as a follow-up batch.
|
|
21
|
+
- The base `Button` atom is fully functional and covers all use cases the purpose wrappers serve.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="neutral" action="button" iconRight={props.iconRight ?? "refreshCw"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("refresh") }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="primary" action="submit" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("save") }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="primary" action="button" iconRight={props.iconRight ?? "search"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("search"), "data-search": "true" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="neutral" action="button" dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("sort"), "data-sort": "true" }} />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from "./Button.svelte";
|
|
3
|
+
import type { ButtonProps } from "./types.js";
|
|
4
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
5
|
+
let props: Props = $props();
|
|
6
|
+
</script>
|
|
7
|
+
<Button {...props} variant="primary" action="submit" as="button" />
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from "./Button.svelte";
|
|
3
|
+
import type { ButtonProps } from "./types.js";
|
|
4
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
5
|
+
let props: Props = $props();
|
|
6
|
+
</script>
|
|
7
|
+
<Button {...props} variant="success" action="button" as="button" />
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ButtonProps } from "./types.js";
|
|
2
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
3
|
+
declare const SuccessButton: import("svelte").Component<Props, {}, "">;
|
|
4
|
+
type SuccessButton = ReturnType<typeof SuccessButton>;
|
|
5
|
+
export default SuccessButton;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="secondary" action="button" iconRight={props.iconRight ?? "upload"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("upload"), "data-transfer": "upload" }} />
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import { createPurposeSemanticAttributes } from "@marwes-ui/core";
|
|
3
|
+
import Button from "./Button.svelte";
|
|
4
|
+
import type { ButtonProps } from "./types.js";
|
|
5
|
+
type Props = Omit<ButtonProps, "variant" | "action" | "as">;
|
|
6
|
+
let { dataAttributes, ...props }: Props = $props();
|
|
7
|
+
</script>
|
|
8
|
+
<Button {...props} variant="secondary" action="button" as="button" iconRight={props.iconRight ?? "checkCircle"} dataAttributes={{ ...dataAttributes, ...createPurposeSemanticAttributes("verify"), "data-verification": "true" }} />
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Button } from "./Button.svelte";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|