@primecoderin/fast-ui-react 0.0.0-stage → 1.0.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 +106 -0
- package/LICENSE +21 -0
- package/README.md +180 -3
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/charts.d.ts +7 -0
- package/dist/charts.js +7 -0
- package/dist/components/Avatar/Avatar.d.ts +12 -0
- package/dist/components/Avatar/Avatar.js +92 -0
- package/dist/components/Button/Button.d.ts +44 -0
- package/dist/components/Button/Button.js +221 -0
- package/dist/components/Checkbox/CheckboxBox.d.ts +33 -0
- package/dist/components/Checkbox/CheckboxBox.js +148 -0
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +26 -0
- package/dist/components/CodeSnippet/CodeSnippet.js +153 -0
- package/dist/components/Collapsible/Collapsible.d.ts +20 -0
- package/dist/components/Collapsible/Collapsible.js +97 -0
- package/dist/components/Container/Container.d.ts +301 -0
- package/dist/components/Container/Container.js +20 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.d.ts +22 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.js +141 -0
- package/dist/components/Grid/Grid.d.ts +311 -0
- package/dist/components/Grid/Grid.js +30 -0
- package/dist/components/IconTile/IconTile.d.ts +12 -0
- package/dist/components/IconTile/IconTile.js +70 -0
- package/dist/components/InlineError/InlineError.d.ts +9 -0
- package/dist/components/InlineError/InlineError.js +62 -0
- package/dist/components/Kbd/Kbd.d.ts +11 -0
- package/dist/components/Kbd/Kbd.js +31 -0
- package/dist/components/Link/Link.d.ts +18 -0
- package/dist/components/Link/Link.js +68 -0
- package/dist/components/Menu/ContextMenu.d.ts +18 -0
- package/dist/components/Menu/ContextMenu.js +68 -0
- package/dist/components/Menu/Menu.d.ts +86 -0
- package/dist/components/Menu/Menu.js +394 -0
- package/dist/components/OtpInput/OtpInput.d.ts +32 -0
- package/dist/components/OtpInput/OtpInput.js +177 -0
- package/dist/components/Popover/HoverPopover.d.ts +22 -0
- package/dist/components/Popover/HoverPopover.js +74 -0
- package/dist/components/Popover/Popover.d.ts +21 -0
- package/dist/components/Popover/Popover.js +64 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +17 -0
- package/dist/components/ProgressBar/ProgressBar.js +44 -0
- package/dist/components/Rating/Rating.d.ts +49 -0
- package/dist/components/Rating/Rating.js +241 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +23 -0
- package/dist/components/ScrollArea/ScrollArea.js +90 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +29 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +99 -0
- package/dist/components/Separator/Separator.d.ts +9 -0
- package/dist/components/Separator/Separator.js +34 -0
- package/dist/components/Skeleton/Skeleton.d.ts +31 -0
- package/dist/components/Skeleton/Skeleton.js +152 -0
- package/dist/components/Slider/Slider.d.ts +54 -0
- package/dist/components/Slider/Slider.js +178 -0
- package/dist/components/Spinner/Spinner.d.ts +17 -0
- package/dist/components/Spinner/Spinner.js +118 -0
- package/dist/components/Stack/Stack.d.ts +302 -0
- package/dist/components/Stack/Stack.js +14 -0
- package/dist/components/StateIcon/StateIcon.d.ts +11 -0
- package/dist/components/StateIcon/StateIcon.js +65 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +19 -0
- package/dist/components/StatusBadge/StatusBadge.js +82 -0
- package/dist/components/Tabs/Tabs.d.ts +28 -0
- package/dist/components/Tabs/Tabs.js +109 -0
- package/dist/components/Tag/Tag.d.ts +11 -0
- package/dist/components/Tag/Tag.js +66 -0
- package/dist/components/Toast/AppToaster.d.ts +8 -0
- package/dist/components/Toast/AppToaster.js +135 -0
- package/dist/components/Toast/toast-manager.d.ts +28 -0
- package/dist/components/Toast/toast-manager.js +47 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +26 -0
- package/dist/components/ToggleButton/ToggleButton.js +106 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +32 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +79 -0
- package/dist/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip.js +58 -0
- package/dist/components/Tooltip/TooltipGroup.d.ts +22 -0
- package/dist/components/Tooltip/TooltipGroup.js +65 -0
- package/dist/components/Typography/Typography.d.ts +17 -0
- package/dist/components/Typography/Typography.js +100 -0
- package/dist/editor-forms.d.ts +1 -0
- package/dist/editor-forms.js +1 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +1 -0
- package/dist/fonts/LICENSE +93 -0
- package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts.css +69 -0
- package/dist/forms.d.ts +22 -0
- package/dist/forms.js +23 -0
- package/dist/foundation.css +23 -0
- package/dist/global.css +116 -0
- package/dist/hooks/useAppToast.d.ts +12 -0
- package/dist/hooks/useAppToast.js +29 -0
- package/dist/icons/icons.d.ts +43 -0
- package/dist/icons/icons.js +44 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.js +101 -0
- package/dist/patterns/Accordion/Accordion.d.ts +35 -0
- package/dist/patterns/Accordion/Accordion.js +139 -0
- package/dist/patterns/Alert/Alert.d.ts +38 -0
- package/dist/patterns/Alert/Alert.js +151 -0
- package/dist/patterns/AppShell/AppShell.d.ts +39 -0
- package/dist/patterns/AppShell/AppShell.js +218 -0
- package/dist/patterns/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/patterns/Breadcrumbs/Breadcrumbs.js +73 -0
- package/dist/patterns/Calendar/Calendar.d.ts +59 -0
- package/dist/patterns/Calendar/Calendar.js +283 -0
- package/dist/patterns/Calendar/DateRangePicker.d.ts +53 -0
- package/dist/patterns/Calendar/DateRangePicker.js +266 -0
- package/dist/patterns/Calendar/FormDateRangeField.d.ts +24 -0
- package/dist/patterns/Calendar/FormDateRangeField.js +138 -0
- package/dist/patterns/Card/Card.d.ts +26 -0
- package/dist/patterns/Card/Card.js +125 -0
- package/dist/patterns/Carousel/Carousel.d.ts +33 -0
- package/dist/patterns/Carousel/Carousel.js +127 -0
- package/dist/patterns/Cascader/Cascader.d.ts +53 -0
- package/dist/patterns/Cascader/Cascader.js +371 -0
- package/dist/patterns/Cascader/FormCascaderField.d.ts +21 -0
- package/dist/patterns/Cascader/FormCascaderField.js +130 -0
- package/dist/patterns/Charts/AreaChart.d.ts +13 -0
- package/dist/patterns/Charts/AreaChart.js +220 -0
- package/dist/patterns/Charts/BarChart.d.ts +11 -0
- package/dist/patterns/Charts/BarChart.js +220 -0
- package/dist/patterns/Charts/DonutChart.d.ts +37 -0
- package/dist/patterns/Charts/DonutChart.js +215 -0
- package/dist/patterns/Charts/GaugeChart.d.ts +44 -0
- package/dist/patterns/Charts/GaugeChart.js +210 -0
- package/dist/patterns/Charts/LineChart.d.ts +14 -0
- package/dist/patterns/Charts/LineChart.js +222 -0
- package/dist/patterns/Charts/Sparkline.d.ts +24 -0
- package/dist/patterns/Charts/Sparkline.js +81 -0
- package/dist/patterns/Charts/chart-parts.d.ts +139 -0
- package/dist/patterns/Charts/chart-parts.js +385 -0
- package/dist/patterns/Charts/gauge-math.d.ts +20 -0
- package/dist/patterns/Charts/gauge-math.js +21 -0
- package/dist/patterns/Charts/sparkline-path.d.ts +11 -0
- package/dist/patterns/Charts/sparkline-path.js +24 -0
- package/dist/patterns/ColorPicker/ColorPicker.d.ts +50 -0
- package/dist/patterns/ColorPicker/ColorPicker.js +590 -0
- package/dist/patterns/ColorPicker/FormColorField.d.ts +21 -0
- package/dist/patterns/ColorPicker/FormColorField.js +130 -0
- package/dist/patterns/ColorPicker/color-value.d.ts +19 -0
- package/dist/patterns/ColorPicker/color-value.js +72 -0
- package/dist/patterns/Combobox/Autocomplete.d.ts +48 -0
- package/dist/patterns/Combobox/Autocomplete.js +158 -0
- package/dist/patterns/Combobox/Combobox.d.ts +52 -0
- package/dist/patterns/Combobox/Combobox.js +195 -0
- package/dist/patterns/Combobox/ComboboxPopup.d.ts +24 -0
- package/dist/patterns/Combobox/ComboboxPopup.js +107 -0
- package/dist/patterns/Combobox/FormAutocompleteField.d.ts +17 -0
- package/dist/patterns/Combobox/FormAutocompleteField.js +119 -0
- package/dist/patterns/Combobox/FormComboboxField.d.ts +18 -0
- package/dist/patterns/Combobox/FormComboboxField.js +119 -0
- package/dist/patterns/Combobox/FormMultiSelectField.d.ts +18 -0
- package/dist/patterns/Combobox/FormMultiSelectField.js +119 -0
- package/dist/patterns/Combobox/MultiSelect.d.ts +54 -0
- package/dist/patterns/Combobox/MultiSelect.js +175 -0
- package/dist/patterns/CommandPalette/CommandPalette.d.ts +50 -0
- package/dist/patterns/CommandPalette/CommandPalette.js +193 -0
- package/dist/patterns/DataTable/DataTable.d.ts +107 -0
- package/dist/patterns/DataTable/DataTable.js +364 -0
- package/dist/patterns/DateTimePicker/DateTimePanel.d.ts +28 -0
- package/dist/patterns/DateTimePicker/DateTimePanel.js +444 -0
- package/dist/patterns/DateTimePicker/DateTimePicker.d.ts +75 -0
- package/dist/patterns/DateTimePicker/DateTimePicker.js +271 -0
- package/dist/patterns/DateTimePicker/FormDateTimeField.d.ts +32 -0
- package/dist/patterns/DateTimePicker/FormDateTimeField.js +148 -0
- package/dist/patterns/DateTimePicker/TimeSliders.d.ts +14 -0
- package/dist/patterns/DateTimePicker/TimeSliders.js +206 -0
- package/dist/patterns/DateTimePicker/picker-labels.d.ts +30 -0
- package/dist/patterns/DateTimePicker/picker-labels.js +23 -0
- package/dist/patterns/DateTimePicker/picker-values.d.ts +98 -0
- package/dist/patterns/DateTimePicker/picker-values.js +194 -0
- package/dist/patterns/DescriptionList/DescriptionList.d.ts +20 -0
- package/dist/patterns/DescriptionList/DescriptionList.js +57 -0
- package/dist/patterns/Dialog/Dialog.d.ts +26 -0
- package/dist/patterns/Dialog/Dialog.js +212 -0
- package/dist/patterns/Drawer/Drawer.d.ts +33 -0
- package/dist/patterns/Drawer/Drawer.js +153 -0
- package/dist/patterns/EmptyState/EmptyState.d.ts +35 -0
- package/dist/patterns/EmptyState/EmptyState.js +44 -0
- package/dist/patterns/FileUpload/FileUpload.d.ts +87 -0
- package/dist/patterns/FileUpload/FileUpload.js +417 -0
- package/dist/patterns/FileUpload/FormFileUploadField.d.ts +19 -0
- package/dist/patterns/FileUpload/FormFileUploadField.js +117 -0
- package/dist/patterns/FileUpload/add-files.d.ts +26 -0
- package/dist/patterns/FileUpload/add-files.js +35 -0
- package/dist/patterns/FileUpload/file-size.d.ts +14 -0
- package/dist/patterns/FileUpload/file-size.js +44 -0
- package/dist/patterns/FormField/CheckboxField.d.ts +26 -0
- package/dist/patterns/FormField/CheckboxField.js +97 -0
- package/dist/patterns/FormField/FieldFrame.d.ts +85 -0
- package/dist/patterns/FormField/FieldFrame.js +257 -0
- package/dist/patterns/FormField/FormCheckboxField.d.ts +17 -0
- package/dist/patterns/FormField/FormCheckboxField.js +92 -0
- package/dist/patterns/FormField/FormRadioGroupField.d.ts +16 -0
- package/dist/patterns/FormField/FormRadioGroupField.js +97 -0
- package/dist/patterns/FormField/FormRatingField.d.ts +19 -0
- package/dist/patterns/FormField/FormRatingField.js +119 -0
- package/dist/patterns/FormField/FormSelectField.d.ts +16 -0
- package/dist/patterns/FormField/FormSelectField.js +91 -0
- package/dist/patterns/FormField/FormSliderField.d.ts +22 -0
- package/dist/patterns/FormField/FormSliderField.js +128 -0
- package/dist/patterns/FormField/FormSwitchField.d.ts +19 -0
- package/dist/patterns/FormField/FormSwitchField.js +88 -0
- package/dist/patterns/FormField/FormTextAreaField.d.ts +12 -0
- package/dist/patterns/FormField/FormTextAreaField.js +91 -0
- package/dist/patterns/FormField/FormTextField.d.ts +23 -0
- package/dist/patterns/FormField/FormTextField.js +103 -0
- package/dist/patterns/FormField/RadioGroupField.d.ts +38 -0
- package/dist/patterns/FormField/RadioGroupField.js +201 -0
- package/dist/patterns/FormField/SelectField.d.ts +43 -0
- package/dist/patterns/FormField/SelectField.js +211 -0
- package/dist/patterns/FormField/SwitchField.d.ts +27 -0
- package/dist/patterns/FormField/SwitchField.js +105 -0
- package/dist/patterns/FormField/TextAreaField.d.ts +37 -0
- package/dist/patterns/FormField/TextAreaField.js +134 -0
- package/dist/patterns/FormField/TextField.d.ts +51 -0
- package/dist/patterns/FormField/TextField.js +256 -0
- package/dist/patterns/FormField/error-message.d.ts +6 -0
- package/dist/patterns/FormField/error-message.js +8 -0
- package/dist/patterns/FormField/field-styles.d.ts +44 -0
- package/dist/patterns/FormField/field-styles.js +89 -0
- package/dist/patterns/FormField/field-types.d.ts +4 -0
- package/dist/patterns/FormField/use-field-ids.d.ts +18 -0
- package/dist/patterns/FormField/use-field-ids.js +53 -0
- package/dist/patterns/List/List.d.ts +38 -0
- package/dist/patterns/List/List.js +174 -0
- package/dist/patterns/MentionsInput/FormMentionsField.d.ts +18 -0
- package/dist/patterns/MentionsInput/FormMentionsField.js +124 -0
- package/dist/patterns/MentionsInput/MentionsInput.d.ts +57 -0
- package/dist/patterns/MentionsInput/MentionsInput.js +133 -0
- package/dist/patterns/MentionsInput/mention-text.d.ts +24 -0
- package/dist/patterns/MentionsInput/mention-text.js +31 -0
- package/dist/patterns/Menubar/Menubar.d.ts +22 -0
- package/dist/patterns/Menubar/Menubar.js +79 -0
- package/dist/patterns/NavigationMenu/NavigationMenu.d.ts +27 -0
- package/dist/patterns/NavigationMenu/NavigationMenu.js +104 -0
- package/dist/patterns/NumberField/FormNumberField.d.ts +18 -0
- package/dist/patterns/NumberField/FormNumberField.js +119 -0
- package/dist/patterns/NumberField/NumberField.d.ts +57 -0
- package/dist/patterns/NumberField/NumberField.js +242 -0
- package/dist/patterns/Pagination/Pagination.d.ts +31 -0
- package/dist/patterns/Pagination/Pagination.js +275 -0
- package/dist/patterns/Pagination/page-items.d.ts +18 -0
- package/dist/patterns/Pagination/page-items.js +40 -0
- package/dist/patterns/PhoneField/FormPhoneField.d.ts +22 -0
- package/dist/patterns/PhoneField/FormPhoneField.js +97 -0
- package/dist/patterns/PhoneField/PhoneField.d.ts +60 -0
- package/dist/patterns/PhoneField/PhoneField.js +448 -0
- package/dist/patterns/PhoneField/phone-value.d.ts +26 -0
- package/dist/patterns/PhoneField/phone-value.js +38 -0
- package/dist/patterns/QRCode/QRCode.d.ts +37 -0
- package/dist/patterns/QRCode/QRCode.js +120 -0
- package/dist/patterns/QRCode/qr-path.d.ts +7 -0
- package/dist/patterns/QRCode/qr-path.js +25 -0
- package/dist/patterns/ResizablePanels/ResizablePanels.d.ts +34 -0
- package/dist/patterns/ResizablePanels/ResizablePanels.js +175 -0
- package/dist/patterns/ResizablePanels/panel-sizes.d.ts +31 -0
- package/dist/patterns/ResizablePanels/panel-sizes.js +54 -0
- package/dist/patterns/RichTextEditor/FormRichTextField.d.ts +18 -0
- package/dist/patterns/RichTextEditor/FormRichTextField.js +118 -0
- package/dist/patterns/RichTextEditor/RichTextEditor.d.ts +71 -0
- package/dist/patterns/RichTextEditor/RichTextEditor.js +453 -0
- package/dist/patterns/SearchInput/SearchInput.d.ts +26 -0
- package/dist/patterns/SearchInput/SearchInput.js +98 -0
- package/dist/patterns/SideNav/SideNav.d.ts +50 -0
- package/dist/patterns/SideNav/SideNav.js +269 -0
- package/dist/patterns/Stat/Stat.d.ts +51 -0
- package/dist/patterns/Stat/Stat.js +292 -0
- package/dist/patterns/Stepper/Stepper.d.ts +35 -0
- package/dist/patterns/Stepper/Stepper.js +110 -0
- package/dist/patterns/TagGroup/TagGroup.d.ts +44 -0
- package/dist/patterns/TagGroup/TagGroup.js +151 -0
- package/dist/patterns/TagsInput/FormTagsInputField.d.ts +18 -0
- package/dist/patterns/TagsInput/FormTagsInputField.js +124 -0
- package/dist/patterns/TagsInput/TagsInput.d.ts +51 -0
- package/dist/patterns/TagsInput/TagsInput.js +97 -0
- package/dist/patterns/Timeline/Timeline.d.ts +29 -0
- package/dist/patterns/Timeline/Timeline.js +85 -0
- package/dist/patterns/Toolbar/Toolbar.d.ts +31 -0
- package/dist/patterns/Toolbar/Toolbar.js +105 -0
- package/dist/patterns/Tour/Tour.d.ts +38 -0
- package/dist/patterns/Tour/Tour.js +333 -0
- package/dist/patterns/TransferList/FormTransferListField.d.ts +19 -0
- package/dist/patterns/TransferList/FormTransferListField.js +117 -0
- package/dist/patterns/TransferList/TransferList.d.ts +53 -0
- package/dist/patterns/TransferList/TransferList.js +441 -0
- package/dist/patterns/TreeSelect/FormTreeSelectField.d.ts +28 -0
- package/dist/patterns/TreeSelect/FormTreeSelectField.js +88 -0
- package/dist/patterns/TreeSelect/TreeSelect.d.ts +49 -0
- package/dist/patterns/TreeSelect/TreeSelect.js +375 -0
- package/dist/patterns/TreeView/TreeView.d.ts +40 -0
- package/dist/patterns/TreeView/TreeView.js +296 -0
- package/dist/provider/DesignSystemProvider.d.ts +54 -0
- package/dist/provider/DesignSystemProvider.js +270 -0
- package/dist/provider/nonce.d.ts +7 -0
- package/dist/provider/nonce.js +13 -0
- package/dist/styles.css +2 -0
- package/dist/theme/chart-palette.d.ts +51 -0
- package/dist/theme/chart-palette.js +112 -0
- package/dist/theme/create-theme.d.ts +52 -0
- package/dist/theme/create-theme.js +75 -0
- package/dist/theme/style-element.d.ts +28 -0
- package/dist/theme/style-element.js +79 -0
- package/dist/theme/tenant-branding.d.ts +48 -0
- package/dist/theme/tenant-branding.js +65 -0
- package/dist/theme/theme-switch.d.ts +25 -0
- package/dist/theme/theme-switch.js +90 -0
- package/dist/theme/token-names.d.ts +3 -0
- package/dist/theme/token-names.js +166 -0
- package/dist/theme.css +241 -0
- package/dist/tokens.css +383 -0
- package/dist/types/direction.d.ts +4 -0
- package/dist/types/tone.d.ts +7 -0
- package/dist/utils/cn.d.ts +7 -0
- package/dist/utils/cn.js +50 -0
- package/dist/utils/first-field.d.ts +8 -0
- package/dist/utils/first-field.js +10 -0
- package/dist/utils/layout.d.ts +33 -0
- package/dist/utils/layout.js +30 -0
- package/dist/utils/popup.d.ts +12 -0
- package/dist/utils/popup.js +27 -0
- package/docs/accessibility.md +61 -0
- package/docs/advanced-components.md +38 -0
- package/docs/ai-assistants.md +44 -0
- package/docs/architecture.md +65 -0
- package/docs/browser-support.md +30 -0
- package/docs/charts.md +56 -0
- package/docs/components.md +2928 -0
- package/docs/conventions.md +19 -0
- package/docs/customization.md +79 -0
- package/docs/dates-files-data.md +48 -0
- package/docs/design-principles.md +50 -0
- package/docs/faq.md +68 -0
- package/docs/forms.md +114 -0
- package/docs/getting-started.md +64 -0
- package/docs/icons.md +48 -0
- package/docs/internationalization.md +64 -0
- package/docs/layout-and-navigation.md +51 -0
- package/docs/nextjs.md +69 -0
- package/docs/releasing.md +40 -0
- package/docs/testing.md +242 -0
- package/docs/theming.md +118 -0
- package/docs/typescript.md +62 -0
- package/llms-full.txt +4573 -0
- package/llms.txt +52 -0
- package/package.json +193 -6
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useId, useState } from "react";
|
|
4
|
+
import { Star } from "lucide-react";
|
|
5
|
+
import { cva } from "class-variance-authority";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/components/Rating/Rating.tsx
|
|
9
|
+
/** A star: grey, or amber and filled while it is part of the rating shown (`data-filled`). */
|
|
10
|
+
var starIcon = cva("text-line-strong data-filled:fill-warning-solid data-filled:text-warning-solid", {
|
|
11
|
+
variants: { size: {
|
|
12
|
+
small: "size-4",
|
|
13
|
+
medium: "size-5",
|
|
14
|
+
large: "size-6.5"
|
|
15
|
+
} },
|
|
16
|
+
defaultVariants: { size: "medium" }
|
|
17
|
+
});
|
|
18
|
+
/**
|
|
19
|
+
* The box of a star that can be chosen: at least 24px square, the least target size (WCAG 2.5.8), with the star in
|
|
20
|
+
* its middle. A large star is bigger than that already and needs no box.
|
|
21
|
+
*/
|
|
22
|
+
var starTarget = cva("relative inline-flex cursor-pointer items-center justify-center rounded-sm has-focus-visible:ring-2 has-focus-visible:ring-focus", {
|
|
23
|
+
variants: { size: {
|
|
24
|
+
small: "size-6",
|
|
25
|
+
medium: "size-6",
|
|
26
|
+
large: ""
|
|
27
|
+
} },
|
|
28
|
+
defaultVariants: { size: "medium" }
|
|
29
|
+
});
|
|
30
|
+
/** The row of stars that can be chosen: the 24px boxes of the smaller sizes touch; large stars keep 2px apart. */
|
|
31
|
+
var starRow = cva("inline-flex items-center", {
|
|
32
|
+
variants: { size: {
|
|
33
|
+
small: "",
|
|
34
|
+
medium: "",
|
|
35
|
+
large: "gap-0.5"
|
|
36
|
+
} },
|
|
37
|
+
defaultVariants: { size: "medium" }
|
|
38
|
+
});
|
|
39
|
+
/**
|
|
40
|
+
* A rating of stars. Each star is a radio button, so the arrow keys move and choose, Tab enters the group once,
|
|
41
|
+
* and a screen reader announces each star by `getValueLabel`. The stars under the pointer preview the choice.
|
|
42
|
+
* With `readOnly` it is an image that shows the rating. Whole stars only.
|
|
43
|
+
*/
|
|
44
|
+
var Rating = (t0) => {
|
|
45
|
+
const $ = c(57);
|
|
46
|
+
const { value, onValueChange, max: t1, readOnly: t2, disabled: t3, clearable: t4, size: t5, invalid: t6, required: t7, getValueLabel, name, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onBlur, inputRef, className } = t0;
|
|
47
|
+
const max = t1 === void 0 ? 5 : t1;
|
|
48
|
+
const readOnly = t2 === void 0 ? false : t2;
|
|
49
|
+
const disabled = t3 === void 0 ? false : t3;
|
|
50
|
+
const clearable = t4 === void 0 ? false : t4;
|
|
51
|
+
const size = t5 === void 0 ? "medium" : t5;
|
|
52
|
+
const invalid = t6 === void 0 ? false : t6;
|
|
53
|
+
const required = t7 === void 0 ? false : t7;
|
|
54
|
+
const groupName = useId();
|
|
55
|
+
const valueId = useId();
|
|
56
|
+
const [hovered, setHovered] = useState(0);
|
|
57
|
+
const shown = hovered || value;
|
|
58
|
+
let t8;
|
|
59
|
+
let t9;
|
|
60
|
+
if ($[0] !== ariaDescribedBy || $[1] !== ariaLabel || $[2] !== ariaLabelledBy || $[3] !== className || $[4] !== clearable || $[5] !== disabled || $[6] !== getValueLabel || $[7] !== groupName || $[8] !== inputRef || $[9] !== invalid || $[10] !== max || $[11] !== name || $[12] !== onBlur || $[13] !== onValueChange || $[14] !== readOnly || $[15] !== required || $[16] !== shown || $[17] !== size || $[18] !== value || $[19] !== valueId) {
|
|
61
|
+
t9 = Symbol.for("react.early_return_sentinel");
|
|
62
|
+
bb0: {
|
|
63
|
+
const stars = Array.from({ length: max }, _temp);
|
|
64
|
+
const isStatic = readOnly || onValueChange === void 0;
|
|
65
|
+
const drawn = stars.map((star) => /* @__PURE__ */ jsx(Star, {
|
|
66
|
+
"aria-hidden": "true",
|
|
67
|
+
"data-filled": star <= shown || void 0,
|
|
68
|
+
className: starIcon({ size })
|
|
69
|
+
}, star));
|
|
70
|
+
if (isStatic) {
|
|
71
|
+
let t10;
|
|
72
|
+
if ($[22] !== getValueLabel || $[23] !== max || $[24] !== value) {
|
|
73
|
+
t10 = getValueLabel(value, max);
|
|
74
|
+
$[22] = getValueLabel;
|
|
75
|
+
$[23] = max;
|
|
76
|
+
$[24] = value;
|
|
77
|
+
$[25] = t10;
|
|
78
|
+
} else t10 = $[25];
|
|
79
|
+
const valueLabel = t10;
|
|
80
|
+
let t11;
|
|
81
|
+
if ($[26] !== ariaLabel || $[27] !== ariaLabelledBy || $[28] !== valueId || $[29] !== valueLabel) {
|
|
82
|
+
t11 = ariaLabelledBy ? { "aria-labelledby": `${ariaLabelledBy} ${valueId}` } : { "aria-label": `${ariaLabel ? `${ariaLabel}: ` : ""}${valueLabel}` };
|
|
83
|
+
$[26] = ariaLabel;
|
|
84
|
+
$[27] = ariaLabelledBy;
|
|
85
|
+
$[28] = valueId;
|
|
86
|
+
$[29] = valueLabel;
|
|
87
|
+
$[30] = t11;
|
|
88
|
+
} else t11 = $[30];
|
|
89
|
+
let t12;
|
|
90
|
+
if ($[31] !== ariaDescribedBy) {
|
|
91
|
+
t12 = ariaDescribedBy ? { "aria-describedby": ariaDescribedBy } : {};
|
|
92
|
+
$[31] = ariaDescribedBy;
|
|
93
|
+
$[32] = t12;
|
|
94
|
+
} else t12 = $[32];
|
|
95
|
+
let t13;
|
|
96
|
+
if ($[33] !== className) {
|
|
97
|
+
t13 = cn("inline-flex items-center gap-0.5", className);
|
|
98
|
+
$[33] = className;
|
|
99
|
+
$[34] = t13;
|
|
100
|
+
} else t13 = $[34];
|
|
101
|
+
let t14;
|
|
102
|
+
if ($[35] !== ariaLabelledBy || $[36] !== valueId || $[37] !== valueLabel) {
|
|
103
|
+
t14 = ariaLabelledBy ? /* @__PURE__ */ jsx("span", {
|
|
104
|
+
id: valueId,
|
|
105
|
+
hidden: true,
|
|
106
|
+
children: valueLabel
|
|
107
|
+
}) : null;
|
|
108
|
+
$[35] = ariaLabelledBy;
|
|
109
|
+
$[36] = valueId;
|
|
110
|
+
$[37] = valueLabel;
|
|
111
|
+
$[38] = t14;
|
|
112
|
+
} else t14 = $[38];
|
|
113
|
+
let t15;
|
|
114
|
+
if ($[39] !== drawn || $[40] !== t11 || $[41] !== t12 || $[42] !== t13 || $[43] !== t14) {
|
|
115
|
+
t15 = /* @__PURE__ */ jsxs("span", {
|
|
116
|
+
role: "img",
|
|
117
|
+
...t11,
|
|
118
|
+
...t12,
|
|
119
|
+
className: t13,
|
|
120
|
+
children: [t14, drawn]
|
|
121
|
+
});
|
|
122
|
+
$[39] = drawn;
|
|
123
|
+
$[40] = t11;
|
|
124
|
+
$[41] = t12;
|
|
125
|
+
$[42] = t13;
|
|
126
|
+
$[43] = t14;
|
|
127
|
+
$[44] = t15;
|
|
128
|
+
} else t15 = $[44];
|
|
129
|
+
t9 = t15;
|
|
130
|
+
break bb0;
|
|
131
|
+
}
|
|
132
|
+
let t10;
|
|
133
|
+
if ($[45] !== ariaLabel) {
|
|
134
|
+
t10 = ariaLabel ? { "aria-label": ariaLabel } : {};
|
|
135
|
+
$[45] = ariaLabel;
|
|
136
|
+
$[46] = t10;
|
|
137
|
+
} else t10 = $[46];
|
|
138
|
+
let t11;
|
|
139
|
+
if ($[47] !== ariaLabelledBy) {
|
|
140
|
+
t11 = ariaLabelledBy ? { "aria-labelledby": ariaLabelledBy } : {};
|
|
141
|
+
$[47] = ariaLabelledBy;
|
|
142
|
+
$[48] = t11;
|
|
143
|
+
} else t11 = $[48];
|
|
144
|
+
let t12;
|
|
145
|
+
if ($[49] !== ariaDescribedBy) {
|
|
146
|
+
t12 = ariaDescribedBy ? { "aria-describedby": ariaDescribedBy } : {};
|
|
147
|
+
$[49] = ariaDescribedBy;
|
|
148
|
+
$[50] = t12;
|
|
149
|
+
} else t12 = $[50];
|
|
150
|
+
let t13;
|
|
151
|
+
if ($[51] !== className || $[52] !== size) {
|
|
152
|
+
t13 = cn(starRow({ size }), className);
|
|
153
|
+
$[51] = className;
|
|
154
|
+
$[52] = size;
|
|
155
|
+
$[53] = t13;
|
|
156
|
+
} else t13 = $[53];
|
|
157
|
+
let t14;
|
|
158
|
+
if ($[54] === Symbol.for("react.memo_cache_sentinel")) {
|
|
159
|
+
t14 = () => {
|
|
160
|
+
setHovered(0);
|
|
161
|
+
};
|
|
162
|
+
$[54] = t14;
|
|
163
|
+
} else t14 = $[54];
|
|
164
|
+
let t15;
|
|
165
|
+
if ($[55] !== onBlur) {
|
|
166
|
+
t15 = (event) => {
|
|
167
|
+
if (!event.currentTarget.contains(event.relatedTarget)) onBlur?.();
|
|
168
|
+
};
|
|
169
|
+
$[55] = onBlur;
|
|
170
|
+
$[56] = t15;
|
|
171
|
+
} else t15 = $[56];
|
|
172
|
+
t8 = /* @__PURE__ */ jsx("div", {
|
|
173
|
+
role: "radiogroup",
|
|
174
|
+
...t10,
|
|
175
|
+
...t11,
|
|
176
|
+
...t12,
|
|
177
|
+
"aria-invalid": invalid || void 0,
|
|
178
|
+
"aria-required": required || void 0,
|
|
179
|
+
className: t13,
|
|
180
|
+
onMouseLeave: t14,
|
|
181
|
+
onBlur: t15,
|
|
182
|
+
children: stars.map((star_0) => /* @__PURE__ */ jsxs("label", {
|
|
183
|
+
className: cn(starTarget({ size }), disabled && "cursor-not-allowed opacity-48"),
|
|
184
|
+
onMouseEnter: () => {
|
|
185
|
+
if (!disabled) setHovered(star_0);
|
|
186
|
+
},
|
|
187
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
188
|
+
type: "radio",
|
|
189
|
+
name: name ?? groupName,
|
|
190
|
+
value: star_0,
|
|
191
|
+
checked: value === star_0,
|
|
192
|
+
disabled,
|
|
193
|
+
"aria-label": getValueLabel(star_0, max),
|
|
194
|
+
ref: star_0 === 1 ? inputRef : void 0,
|
|
195
|
+
className: "absolute inset-0 size-full cursor-[inherit] appearance-none opacity-0",
|
|
196
|
+
onChange: () => {
|
|
197
|
+
onValueChange(star_0);
|
|
198
|
+
},
|
|
199
|
+
onClick: () => {
|
|
200
|
+
if (clearable && value === star_0) {
|
|
201
|
+
setHovered(0);
|
|
202
|
+
onValueChange(0);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}), drawn[star_0 - 1]]
|
|
206
|
+
}, star_0))
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
$[0] = ariaDescribedBy;
|
|
210
|
+
$[1] = ariaLabel;
|
|
211
|
+
$[2] = ariaLabelledBy;
|
|
212
|
+
$[3] = className;
|
|
213
|
+
$[4] = clearable;
|
|
214
|
+
$[5] = disabled;
|
|
215
|
+
$[6] = getValueLabel;
|
|
216
|
+
$[7] = groupName;
|
|
217
|
+
$[8] = inputRef;
|
|
218
|
+
$[9] = invalid;
|
|
219
|
+
$[10] = max;
|
|
220
|
+
$[11] = name;
|
|
221
|
+
$[12] = onBlur;
|
|
222
|
+
$[13] = onValueChange;
|
|
223
|
+
$[14] = readOnly;
|
|
224
|
+
$[15] = required;
|
|
225
|
+
$[16] = shown;
|
|
226
|
+
$[17] = size;
|
|
227
|
+
$[18] = value;
|
|
228
|
+
$[19] = valueId;
|
|
229
|
+
$[20] = t8;
|
|
230
|
+
$[21] = t9;
|
|
231
|
+
} else {
|
|
232
|
+
t8 = $[20];
|
|
233
|
+
t9 = $[21];
|
|
234
|
+
}
|
|
235
|
+
if (t9 !== Symbol.for("react.early_return_sentinel")) return t9;
|
|
236
|
+
return t8;
|
|
237
|
+
};
|
|
238
|
+
function _temp(_, index) {
|
|
239
|
+
return index + 1;
|
|
240
|
+
}
|
|
241
|
+
export { Rating };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CSSProperties, ReactNode } from "react";
|
|
2
|
+
export interface ScrollAreaProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Accessible name of the scrolling region, e.g. "Activity log". The region takes the keyboard focus, so the
|
|
6
|
+
* arrow keys, Page Up and Page Down scroll it for a person who cannot use a pointer.
|
|
7
|
+
*/
|
|
8
|
+
"aria-label": string;
|
|
9
|
+
/** Which way it scrolls: up and down (default), sideways, or both. */
|
|
10
|
+
orientation?: "vertical" | "horizontal" | "both" | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The size that makes it scroll: `{ maxHeight: 320 }`. Without one the area is as tall as its content and has
|
|
13
|
+
* nothing to scroll. A number is pixels.
|
|
14
|
+
*/
|
|
15
|
+
style?: CSSProperties | undefined;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A region that scrolls with the design system's own slim scrollbars, which show while the pointer is over it or
|
|
20
|
+
* it scrolls. The browser's scrolling still does the work (wheel, touch, keys), so it feels native. Give it a
|
|
21
|
+
* height or width through `style`.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ScrollArea: ({ children, "aria-label": ariaLabel, orientation, style, className }: ScrollAreaProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
7
|
+
var THUMB = "rounded-pill bg-line-strong";
|
|
8
|
+
/**
|
|
9
|
+
* A region that scrolls with the design system's own slim scrollbars, which show while the pointer is over it or
|
|
10
|
+
* it scrolls. The browser's scrolling still does the work (wheel, touch, keys), so it feels native. Give it a
|
|
11
|
+
* height or width through `style`.
|
|
12
|
+
*/
|
|
13
|
+
var ScrollArea = (t0) => {
|
|
14
|
+
const $ = c(20);
|
|
15
|
+
const { children, "aria-label": ariaLabel, orientation: t1, style, className } = t0;
|
|
16
|
+
const orientation = t1 === void 0 ? "vertical" : t1;
|
|
17
|
+
let t2;
|
|
18
|
+
if ($[0] !== className) {
|
|
19
|
+
t2 = cn("relative min-w-0 overflow-hidden", className);
|
|
20
|
+
$[0] = className;
|
|
21
|
+
$[1] = t2;
|
|
22
|
+
} else t2 = $[1];
|
|
23
|
+
let t3;
|
|
24
|
+
if ($[2] !== children) {
|
|
25
|
+
t3 = /* @__PURE__ */ jsx(ScrollArea$1.Content, { children });
|
|
26
|
+
$[2] = children;
|
|
27
|
+
$[3] = t3;
|
|
28
|
+
} else t3 = $[3];
|
|
29
|
+
let t4;
|
|
30
|
+
if ($[4] !== ariaLabel || $[5] !== t3) {
|
|
31
|
+
t4 = /* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
32
|
+
role: "region",
|
|
33
|
+
"aria-label": ariaLabel,
|
|
34
|
+
tabIndex: 0,
|
|
35
|
+
className: "size-full max-h-[inherit] max-w-[inherit] rounded-[inherit] outline-none focus-visible:ring-2 focus-visible:ring-focus focus-visible:ring-inset",
|
|
36
|
+
children: t3
|
|
37
|
+
});
|
|
38
|
+
$[4] = ariaLabel;
|
|
39
|
+
$[5] = t3;
|
|
40
|
+
$[6] = t4;
|
|
41
|
+
} else t4 = $[6];
|
|
42
|
+
let t5;
|
|
43
|
+
if ($[7] !== orientation) {
|
|
44
|
+
t5 = orientation === "horizontal" ? null : /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
45
|
+
orientation: "vertical",
|
|
46
|
+
className: "flex w-2 touch-none p-0.5 opacity-0 transition-opacity duration-150 select-none data-hovering:opacity-100 data-scrolling:opacity-100 motion-reduce:transition-none",
|
|
47
|
+
children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, { className: cn(THUMB, "w-full") })
|
|
48
|
+
});
|
|
49
|
+
$[7] = orientation;
|
|
50
|
+
$[8] = t5;
|
|
51
|
+
} else t5 = $[8];
|
|
52
|
+
let t6;
|
|
53
|
+
if ($[9] !== orientation) {
|
|
54
|
+
t6 = orientation === "vertical" ? null : /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
55
|
+
orientation: "horizontal",
|
|
56
|
+
className: "flex h-2 touch-none flex-col p-0.5 opacity-0 transition-opacity duration-150 select-none data-hovering:opacity-100 data-scrolling:opacity-100 motion-reduce:transition-none",
|
|
57
|
+
children: /* @__PURE__ */ jsx(ScrollArea$1.Thumb, { className: cn(THUMB, "h-full") })
|
|
58
|
+
});
|
|
59
|
+
$[9] = orientation;
|
|
60
|
+
$[10] = t6;
|
|
61
|
+
} else t6 = $[10];
|
|
62
|
+
let t7;
|
|
63
|
+
if ($[11] !== orientation) {
|
|
64
|
+
t7 = orientation === "both" ? /* @__PURE__ */ jsx(ScrollArea$1.Corner, {}) : null;
|
|
65
|
+
$[11] = orientation;
|
|
66
|
+
$[12] = t7;
|
|
67
|
+
} else t7 = $[12];
|
|
68
|
+
let t8;
|
|
69
|
+
if ($[13] !== style || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== t6 || $[18] !== t7) {
|
|
70
|
+
t8 = /* @__PURE__ */ jsxs(ScrollArea$1.Root, {
|
|
71
|
+
style,
|
|
72
|
+
className: t2,
|
|
73
|
+
children: [
|
|
74
|
+
t4,
|
|
75
|
+
t5,
|
|
76
|
+
t6,
|
|
77
|
+
t7
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
$[13] = style;
|
|
81
|
+
$[14] = t2;
|
|
82
|
+
$[15] = t4;
|
|
83
|
+
$[16] = t5;
|
|
84
|
+
$[17] = t6;
|
|
85
|
+
$[18] = t7;
|
|
86
|
+
$[19] = t8;
|
|
87
|
+
} else t8 = $[19];
|
|
88
|
+
return t8;
|
|
89
|
+
};
|
|
90
|
+
export { ScrollArea };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface SegmentedItem {
|
|
2
|
+
/** What `value` and `onValueChange` hold while this choice is made. */
|
|
3
|
+
value: string;
|
|
4
|
+
/** The choice's text, which is also its accessible name. */
|
|
5
|
+
label: string;
|
|
6
|
+
/** What the choice means, read by screen readers after its label (e.g. what "Auto" follows). */
|
|
7
|
+
description?: string | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface SegmentedControlProps {
|
|
10
|
+
/** The choices, in order. Each `value` must be unique: it is the choice's key and what `onValueChange` reports. */
|
|
11
|
+
items: readonly SegmentedItem[];
|
|
12
|
+
/** The `value` of the chosen item. */
|
|
13
|
+
value: string;
|
|
14
|
+
/** Called with the `value` of the item chosen, by a click or by the arrow keys. */
|
|
15
|
+
onValueChange: (value: string) => void;
|
|
16
|
+
/** Accessible name of the group, e.g. "Filter by status". */
|
|
17
|
+
"aria-label": string;
|
|
18
|
+
/** Stretch to the width of the container and share it equally; a long label may wrap onto a second line. */
|
|
19
|
+
fill?: boolean | undefined;
|
|
20
|
+
/** Classes for the grey pill around the choices, merged last. */
|
|
21
|
+
className?: string | undefined;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* A few mutually exclusive choices in a grey pill, the
|
|
25
|
+
* chosen one raised on white in teal text. For a view filter that applies at
|
|
26
|
+
* once (All, Active, Inactive); the arrow keys move and choose, like a radio
|
|
27
|
+
* group, which it is.
|
|
28
|
+
*/
|
|
29
|
+
export declare const SegmentedControl: ({ items, value, onValueChange: onChange, "aria-label": ariaLabel, fill, className }: SegmentedControlProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useId } from "react";
|
|
4
|
+
import { Radio } from "@base-ui/react/radio";
|
|
5
|
+
import { RadioGroup } from "@base-ui/react/radio-group";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
9
|
+
/**
|
|
10
|
+
* A few mutually exclusive choices in a grey pill, the
|
|
11
|
+
* chosen one raised on white in teal text. For a view filter that applies at
|
|
12
|
+
* once (All, Active, Inactive); the arrow keys move and choose, like a radio
|
|
13
|
+
* group, which it is.
|
|
14
|
+
*/
|
|
15
|
+
var SegmentedControl = (t0) => {
|
|
16
|
+
const $ = c(26);
|
|
17
|
+
const { items, value, onValueChange: onChange, "aria-label": ariaLabel, fill: t1, className } = t0;
|
|
18
|
+
const fill = t1 === void 0 ? false : t1;
|
|
19
|
+
const id = useId();
|
|
20
|
+
let t2;
|
|
21
|
+
if ($[0] !== id) {
|
|
22
|
+
t2 = (index) => `${id}-${String(index)}-description`;
|
|
23
|
+
$[0] = id;
|
|
24
|
+
$[1] = t2;
|
|
25
|
+
} else t2 = $[1];
|
|
26
|
+
const descriptionId = t2;
|
|
27
|
+
let t3;
|
|
28
|
+
if ($[2] !== onChange) {
|
|
29
|
+
t3 = (next) => {
|
|
30
|
+
onChange(next);
|
|
31
|
+
};
|
|
32
|
+
$[2] = onChange;
|
|
33
|
+
$[3] = t3;
|
|
34
|
+
} else t3 = $[3];
|
|
35
|
+
const t4 = fill && "flex w-full";
|
|
36
|
+
let t5;
|
|
37
|
+
if ($[4] !== className || $[5] !== t4) {
|
|
38
|
+
t5 = cn("inline-flex items-center rounded-md bg-subtle p-0.75", t4, className);
|
|
39
|
+
$[4] = className;
|
|
40
|
+
$[5] = t4;
|
|
41
|
+
$[6] = t5;
|
|
42
|
+
} else t5 = $[6];
|
|
43
|
+
let t6;
|
|
44
|
+
if ($[7] !== descriptionId || $[8] !== fill || $[9] !== items) {
|
|
45
|
+
let t7;
|
|
46
|
+
if ($[11] !== descriptionId || $[12] !== fill) {
|
|
47
|
+
t7 = (item, index_0) => /* @__PURE__ */ jsx(Radio.Root, {
|
|
48
|
+
value: item.value,
|
|
49
|
+
"aria-describedby": item.description ? descriptionId(index_0) : void 0,
|
|
50
|
+
className: cn("box-border inline-flex min-h-8.5 cursor-pointer items-center rounded-sm border-0 bg-transparent px-2.75 text-caption font-medium whitespace-nowrap text-fg-secondary outline-none", fill && "flex-1 justify-center px-1.5 py-1 text-center leading-[1.25] whitespace-normal", "transition-[color,background-color,box-shadow] duration-150 ease-standard", "hover:text-fg data-checked:bg-surface data-checked:text-primary-text data-checked:shadow-sm", "focus-visible:ring-2 focus-visible:ring-focus"),
|
|
51
|
+
children: item.label
|
|
52
|
+
}, item.value);
|
|
53
|
+
$[11] = descriptionId;
|
|
54
|
+
$[12] = fill;
|
|
55
|
+
$[13] = t7;
|
|
56
|
+
} else t7 = $[13];
|
|
57
|
+
t6 = items.map(t7);
|
|
58
|
+
$[7] = descriptionId;
|
|
59
|
+
$[8] = fill;
|
|
60
|
+
$[9] = items;
|
|
61
|
+
$[10] = t6;
|
|
62
|
+
} else t6 = $[10];
|
|
63
|
+
let t7;
|
|
64
|
+
if ($[14] !== descriptionId || $[15] !== items) {
|
|
65
|
+
let t8;
|
|
66
|
+
if ($[17] !== descriptionId) {
|
|
67
|
+
t8 = (item_0, index_1) => item_0.description ? /* @__PURE__ */ jsx("span", {
|
|
68
|
+
id: descriptionId(index_1),
|
|
69
|
+
hidden: true,
|
|
70
|
+
children: item_0.description
|
|
71
|
+
}, item_0.value) : null;
|
|
72
|
+
$[17] = descriptionId;
|
|
73
|
+
$[18] = t8;
|
|
74
|
+
} else t8 = $[18];
|
|
75
|
+
t7 = items.map(t8);
|
|
76
|
+
$[14] = descriptionId;
|
|
77
|
+
$[15] = items;
|
|
78
|
+
$[16] = t7;
|
|
79
|
+
} else t7 = $[16];
|
|
80
|
+
let t8;
|
|
81
|
+
if ($[19] !== ariaLabel || $[20] !== t3 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== value) {
|
|
82
|
+
t8 = /* @__PURE__ */ jsxs(RadioGroup, {
|
|
83
|
+
value,
|
|
84
|
+
onValueChange: t3,
|
|
85
|
+
"aria-label": ariaLabel,
|
|
86
|
+
className: t5,
|
|
87
|
+
children: [t6, t7]
|
|
88
|
+
});
|
|
89
|
+
$[19] = ariaLabel;
|
|
90
|
+
$[20] = t3;
|
|
91
|
+
$[21] = t5;
|
|
92
|
+
$[22] = t6;
|
|
93
|
+
$[23] = t7;
|
|
94
|
+
$[24] = value;
|
|
95
|
+
$[25] = t8;
|
|
96
|
+
} else t8 = $[25];
|
|
97
|
+
return t8;
|
|
98
|
+
};
|
|
99
|
+
export { SegmentedControl };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface SeparatorProps {
|
|
2
|
+
/** A horizontal rule (default) or a vertical one, which fills the height of a row. */
|
|
3
|
+
orientation?: "horizontal" | "vertical" | undefined;
|
|
4
|
+
/** "strong" is darker, for a rule that must be seen on a tinted surface. */
|
|
5
|
+
tone?: "default" | "strong" | undefined;
|
|
6
|
+
className?: string | undefined;
|
|
7
|
+
}
|
|
8
|
+
/** A thin rule between groups. It is `role="separator"`, so a screen reader announces the break. */
|
|
9
|
+
export declare const Separator: ({ orientation, tone, className }: SeparatorProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
// src/components/Separator/Separator.tsx
|
|
7
|
+
/** A thin rule between groups. It is `role="separator"`, so a screen reader announces the break. */
|
|
8
|
+
var Separator = (t0) => {
|
|
9
|
+
const $ = c(7);
|
|
10
|
+
const { orientation: t1, tone: t2, className } = t0;
|
|
11
|
+
const orientation = t1 === void 0 ? "horizontal" : t1;
|
|
12
|
+
const t3 = (t2 === void 0 ? "default" : t2) === "strong" ? "bg-line-strong" : "bg-line";
|
|
13
|
+
const t4 = orientation === "vertical" ? "w-px self-stretch" : "h-px w-full";
|
|
14
|
+
let t5;
|
|
15
|
+
if ($[0] !== className || $[1] !== t3 || $[2] !== t4) {
|
|
16
|
+
t5 = cn("shrink-0 border-0", t3, t4, className);
|
|
17
|
+
$[0] = className;
|
|
18
|
+
$[1] = t3;
|
|
19
|
+
$[2] = t4;
|
|
20
|
+
$[3] = t5;
|
|
21
|
+
} else t5 = $[3];
|
|
22
|
+
let t6;
|
|
23
|
+
if ($[4] !== orientation || $[5] !== t5) {
|
|
24
|
+
t6 = /* @__PURE__ */ jsx(Separator$1, {
|
|
25
|
+
orientation,
|
|
26
|
+
className: t5
|
|
27
|
+
});
|
|
28
|
+
$[4] = orientation;
|
|
29
|
+
$[5] = t5;
|
|
30
|
+
$[6] = t6;
|
|
31
|
+
} else t6 = $[6];
|
|
32
|
+
return t6;
|
|
33
|
+
};
|
|
34
|
+
export { Separator };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** What SkeletonCard takes, and what SkeletonText and SkeletonTable add to. */
|
|
2
|
+
export interface SkeletonProps {
|
|
3
|
+
/** What is loading, for assistive technology, e.g. "Loading results". */
|
|
4
|
+
label: string;
|
|
5
|
+
}
|
|
6
|
+
export interface SkeletonItemProps {
|
|
7
|
+
/** The bar's height in pixels: 12 (default) for a line of text, 16 for a heading. */
|
|
8
|
+
size?: 12 | 16 | undefined;
|
|
9
|
+
/** The bar's width as a CSS length, e.g. "60%". Without it the bar is as wide as its container. */
|
|
10
|
+
width?: string | undefined;
|
|
11
|
+
/** Classes for the bar, e.g. `flex-1` in a row. */
|
|
12
|
+
className?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface SkeletonTextProps extends SkeletonProps {
|
|
15
|
+
/** How many lines; the last is shorter, as a paragraph's is. Default 3. */
|
|
16
|
+
lines?: number | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface SkeletonTableProps extends SkeletonProps {
|
|
19
|
+
/** How many rows. Default 5. */
|
|
20
|
+
rows?: number | undefined;
|
|
21
|
+
/** How many columns in each row. Default 4. */
|
|
22
|
+
columns?: number | undefined;
|
|
23
|
+
}
|
|
24
|
+
/** One placeholder bar. Decorative: the region around it carries the label. */
|
|
25
|
+
export declare const SkeletonItem: ({ size, width, className }: SkeletonItemProps) => import("react").JSX.Element;
|
|
26
|
+
/** Placeholder lines for text that has not arrived. */
|
|
27
|
+
export declare const SkeletonText: ({ label, lines }: SkeletonTextProps) => import("react").JSX.Element;
|
|
28
|
+
/** Placeholder for a card: a heading line and two lines of text. */
|
|
29
|
+
export declare const SkeletonCard: ({ label }: SkeletonProps) => import("react").JSX.Element;
|
|
30
|
+
/** Placeholder rows for a table that is loading. */
|
|
31
|
+
export declare const SkeletonTable: ({ label, rows, columns }: SkeletonTableProps) => import("react").JSX.Element;
|