@jbpark/ui-kit 10.1.0 → 10.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/dist/Alert.d.mts +24 -0
- package/dist/Alert.d.mts.map +1 -0
- package/dist/Alert.mjs +68 -0
- package/dist/Alert.mjs.map +1 -0
- package/dist/Anchor.d.mts +29 -0
- package/dist/Anchor.d.mts.map +1 -0
- package/dist/Anchor.mjs +120 -0
- package/dist/Anchor.mjs.map +1 -0
- package/dist/AutoComplete.d.mts +34 -0
- package/dist/AutoComplete.d.mts.map +1 -0
- package/dist/AutoComplete.mjs +82 -0
- package/dist/AutoComplete.mjs.map +1 -0
- package/dist/Avatar.d.mts +19 -0
- package/dist/Avatar.d.mts.map +1 -0
- package/dist/Avatar.mjs +43 -0
- package/dist/Avatar.mjs.map +1 -0
- package/dist/Badge.d.mts +23 -0
- package/dist/Badge.d.mts.map +1 -0
- package/dist/Badge.mjs +41 -0
- package/dist/Badge.mjs.map +1 -0
- package/dist/Breadcrumb.d.mts +3 -3
- package/dist/Breadcrumb.d.mts.map +1 -1
- package/dist/Breadcrumb.mjs +1 -1
- package/dist/Breadcrumb.mjs.map +1 -1
- package/dist/Button.d.mts +3 -3
- package/dist/Button.d.mts.map +1 -1
- package/dist/Button.mjs +1 -1
- package/dist/Calendar.d.mts +28 -0
- package/dist/Calendar.d.mts.map +1 -0
- package/dist/Calendar.mjs +64 -0
- package/dist/Calendar.mjs.map +1 -0
- package/dist/Card.d.mts +2 -2
- package/dist/Card.d.mts.map +1 -1
- package/dist/Cascader.d.mts +34 -0
- package/dist/Cascader.d.mts.map +1 -0
- package/dist/Cascader.mjs +144 -0
- package/dist/Cascader.mjs.map +1 -0
- package/dist/CodeEditor.d.mts +2 -2
- package/dist/CodeEditor.d.mts.map +1 -1
- package/dist/ContextMenu.d.mts +33 -0
- package/dist/ContextMenu.d.mts.map +1 -0
- package/dist/ContextMenu.mjs +92 -0
- package/dist/ContextMenu.mjs.map +1 -0
- package/dist/Descriptions.d.mts +31 -0
- package/dist/Descriptions.d.mts.map +1 -0
- package/dist/Descriptions.mjs +67 -0
- package/dist/Descriptions.mjs.map +1 -0
- package/dist/Divider.d.mts +18 -0
- package/dist/Divider.d.mts.map +1 -0
- package/dist/Divider.mjs +44 -0
- package/dist/Divider.mjs.map +1 -0
- package/dist/Form.d.mts +12 -0
- package/dist/Form.d.mts.map +1 -0
- package/dist/Form.mjs +11 -0
- package/dist/Form.mjs.map +1 -0
- package/dist/Layout.d.mts.map +1 -1
- package/dist/Mentions.d.mts +34 -0
- package/dist/Mentions.d.mts.map +1 -0
- package/dist/Mentions.mjs +207 -0
- package/dist/Mentions.mjs.map +1 -0
- package/dist/Menu.mjs +1 -2
- package/dist/Pagination.d.mts +2 -2
- package/dist/Pagination.d.mts.map +1 -1
- package/dist/Pagination.mjs +1 -1
- package/dist/Popconfirm.d.mts +33 -0
- package/dist/Popconfirm.d.mts.map +1 -0
- package/dist/Popconfirm.mjs +119 -0
- package/dist/Popconfirm.mjs.map +1 -0
- package/dist/Rate.d.mts +27 -0
- package/dist/Rate.d.mts.map +1 -0
- package/dist/Rate.mjs +81 -0
- package/dist/Rate.mjs.map +1 -0
- package/dist/Reveals.d.mts.map +1 -1
- package/dist/ScrollArea.d.mts +8 -0
- package/dist/ScrollArea.d.mts.map +1 -0
- package/dist/ScrollArea.mjs +11 -0
- package/dist/ScrollArea.mjs.map +1 -0
- package/dist/Segmented.d.mts +26 -0
- package/dist/Segmented.d.mts.map +1 -0
- package/dist/Segmented.mjs +57 -0
- package/dist/Segmented.mjs.map +1 -0
- package/dist/Space.d.mts +2 -2
- package/dist/Space.d.mts.map +1 -1
- package/dist/Statistic.d.mts +22 -0
- package/dist/Statistic.d.mts.map +1 -0
- package/dist/Statistic.mjs +53 -0
- package/dist/Statistic.mjs.map +1 -0
- package/dist/Steps.d.mts +28 -0
- package/dist/Steps.d.mts.map +1 -0
- package/dist/Steps.mjs +70 -0
- package/dist/Steps.mjs.map +1 -0
- package/dist/Table.d.mts +4 -4
- package/dist/Table.d.mts.map +1 -1
- package/dist/Tag.d.mts +3 -3
- package/dist/Tag.d.mts.map +1 -1
- package/dist/TimePicker.d.mts +26 -0
- package/dist/TimePicker.d.mts.map +1 -0
- package/dist/TimePicker.mjs +77 -0
- package/dist/TimePicker.mjs.map +1 -0
- package/dist/Timeline.d.mts +35 -0
- package/dist/Timeline.d.mts.map +1 -0
- package/dist/Timeline.mjs +59 -0
- package/dist/Timeline.mjs.map +1 -0
- package/dist/Tour.d.mts +37 -0
- package/dist/Tour.d.mts.map +1 -0
- package/dist/Tour.mjs +192 -0
- package/dist/Tour.mjs.map +1 -0
- package/dist/Transfer.d.mts +36 -0
- package/dist/Transfer.d.mts.map +1 -0
- package/dist/Transfer.mjs +147 -0
- package/dist/Transfer.mjs.map +1 -0
- package/dist/Tree.d.mts +62 -0
- package/dist/Tree.d.mts.map +1 -0
- package/dist/Tree.mjs +462 -0
- package/dist/Tree.mjs.map +1 -0
- package/dist/TreeSelect.d.mts +34 -0
- package/dist/TreeSelect.d.mts.map +1 -0
- package/dist/TreeSelect.mjs +135 -0
- package/dist/TreeSelect.mjs.map +1 -0
- package/dist/Typography.d.mts.map +1 -1
- package/dist/components/atoms/checkbox/checkbox.d.mts +5 -3
- package/dist/components/atoms/checkbox/checkbox.d.mts.map +1 -1
- package/dist/components/atoms/checkbox/checkbox.mjs +8 -4
- package/dist/components/atoms/checkbox/checkbox.mjs.map +1 -1
- package/dist/components/atoms/checkbox/group.d.mts +2 -2
- package/dist/components/atoms/checkbox/group.d.mts.map +1 -1
- package/dist/components/atoms/checkbox/index.d.mts.map +1 -1
- package/dist/components/atoms/color-picker.d.mts +2 -2
- package/dist/components/atoms/color-picker.d.mts.map +1 -1
- package/dist/components/atoms/date-picker.d.mts +5 -1
- package/dist/components/atoms/date-picker.d.mts.map +1 -1
- package/dist/components/atoms/date-picker.mjs +54 -10
- package/dist/components/atoms/date-picker.mjs.map +1 -1
- package/dist/components/atoms/float-button/back-top.d.mts +2 -2
- package/dist/components/atoms/float-button/back-top.d.mts.map +1 -1
- package/dist/components/atoms/float-button/back-top.mjs +1 -1
- package/dist/components/atoms/float-button/float-button.d.mts +2 -2
- package/dist/components/atoms/float-button/float-button.d.mts.map +1 -1
- package/dist/components/atoms/float-button/index.d.mts.map +1 -1
- package/dist/components/atoms/index.d.mts +13 -2
- package/dist/components/atoms/input/index.d.mts +5 -1
- package/dist/components/atoms/input/index.d.mts.map +1 -1
- package/dist/components/atoms/input/index.mjs +5 -1
- package/dist/components/atoms/input/index.mjs.map +1 -1
- package/dist/components/atoms/input/number.d.mts +23 -0
- package/dist/components/atoms/input/number.d.mts.map +1 -0
- package/dist/components/atoms/input/number.mjs +71 -0
- package/dist/components/atoms/input/number.mjs.map +1 -0
- package/dist/components/atoms/input/otp.d.mts +26 -0
- package/dist/components/atoms/input/otp.d.mts.map +1 -0
- package/dist/components/atoms/input/otp.mjs +52 -0
- package/dist/components/atoms/input/otp.mjs.map +1 -0
- package/dist/components/atoms/input/search.d.mts +2 -7
- package/dist/components/atoms/input/search.d.mts.map +1 -1
- package/dist/components/atoms/input/search.mjs +6 -8
- package/dist/components/atoms/input/search.mjs.map +1 -1
- package/dist/components/atoms/mentions-token.mjs +31 -0
- package/dist/components/atoms/mentions-token.mjs.map +1 -0
- package/dist/components/atoms/option-group.d.mts +4 -5
- package/dist/components/atoms/option-group.d.mts.map +1 -1
- package/dist/components/atoms/popover.d.mts +2 -2
- package/dist/components/atoms/popover.d.mts.map +1 -1
- package/dist/components/atoms/progress.d.mts +5 -3
- package/dist/components/atoms/progress.d.mts.map +1 -1
- package/dist/components/atoms/progress.mjs +2 -2
- package/dist/components/atoms/progress.mjs.map +1 -1
- package/dist/components/atoms/radio/group.d.mts +2 -2
- package/dist/components/atoms/radio/group.d.mts.map +1 -1
- package/dist/components/atoms/radio/group.mjs +1 -1
- package/dist/components/atoms/radio/index.d.mts.map +1 -1
- package/dist/components/atoms/radio/radio.d.mts +2 -2
- package/dist/components/atoms/radio/radio.d.mts.map +1 -1
- package/dist/components/atoms/radio/radio.mjs +1 -1
- package/dist/components/atoms/rich-text-editor/rich-text-editor.d.mts +8 -3
- package/dist/components/atoms/rich-text-editor/rich-text-editor.d.mts.map +1 -1
- package/dist/components/atoms/rich-text-editor/rich-text-editor.mjs +7 -2
- package/dist/components/atoms/rich-text-editor/rich-text-editor.mjs.map +1 -1
- package/dist/components/atoms/rich-text-editor/toolbar-presets.mjs +2 -2
- package/dist/components/atoms/rich-text-editor/types.d.mts +2 -3
- package/dist/components/atoms/rich-text-editor/types.d.mts.map +1 -1
- package/dist/components/atoms/select-multiple.d.mts +2 -3
- package/dist/components/atoms/select-multiple.d.mts.map +1 -1
- package/dist/components/atoms/select-multiple.mjs +4 -3
- package/dist/components/atoms/select-multiple.mjs.map +1 -1
- package/dist/components/atoms/select-searchable-options.d.mts +3 -4
- package/dist/components/atoms/select-searchable-options.d.mts.map +1 -1
- package/dist/components/atoms/select-searchable.d.mts +2 -3
- package/dist/components/atoms/select-searchable.d.mts.map +1 -1
- package/dist/components/atoms/select-searchable.mjs +4 -3
- package/dist/components/atoms/select-searchable.mjs.map +1 -1
- package/dist/components/atoms/select.d.mts +4 -4
- package/dist/components/atoms/select.d.mts.map +1 -1
- package/dist/components/atoms/select.mjs +1 -1
- package/dist/components/atoms/select.mjs.map +1 -1
- package/dist/components/atoms/skeleton/button.d.mts.map +1 -1
- package/dist/components/atoms/skeleton/index.d.mts.map +1 -1
- package/dist/components/atoms/skeleton/node.d.mts.map +1 -1
- package/dist/components/atoms/skeleton/skeleton.d.mts +5 -3
- package/dist/components/atoms/skeleton/skeleton.d.mts.map +1 -1
- package/dist/components/atoms/skeleton/skeleton.mjs +2 -2
- package/dist/components/atoms/skeleton/skeleton.mjs.map +1 -1
- package/dist/components/atoms/slider/slider.d.mts +3 -3
- package/dist/components/atoms/slider/slider.d.mts.map +1 -1
- package/dist/components/atoms/spin.d.mts +2 -2
- package/dist/components/atoms/spin.d.mts.map +1 -1
- package/dist/components/atoms/spin.mjs +1 -1
- package/dist/components/atoms/switch.d.mts +2 -2
- package/dist/components/atoms/switch.d.mts.map +1 -1
- package/dist/components/atoms/tooltip.d.mts +2 -2
- package/dist/components/atoms/tooltip.d.mts.map +1 -1
- package/dist/components/atoms/typography/link.d.mts +2 -2
- package/dist/components/atoms/typography/link.d.mts.map +1 -1
- package/dist/components/atoms/typography/paragraph.d.mts +2 -2
- package/dist/components/atoms/typography/paragraph.d.mts.map +1 -1
- package/dist/components/atoms/typography/text.d.mts +2 -2
- package/dist/components/atoms/typography/text.d.mts.map +1 -1
- package/dist/components/atoms/typography/title.d.mts +2 -2
- package/dist/components/atoms/typography/title.d.mts.map +1 -1
- package/dist/components/atoms/typography/typography.d.mts +2 -2
- package/dist/components/atoms/typography/typography.d.mts.map +1 -1
- package/dist/components/molecules/collapse.d.mts +9 -9
- package/dist/components/molecules/collapse.d.mts.map +1 -1
- package/dist/components/molecules/collapse.mjs +11 -2
- package/dist/components/molecules/collapse.mjs.map +1 -1
- package/dist/components/molecules/dropdown.d.mts +2 -2
- package/dist/components/molecules/dropdown.d.mts.map +1 -1
- package/dist/components/molecules/index.d.mts +23 -13
- package/dist/components/molecules/marquees/index.d.mts.map +1 -1
- package/dist/components/molecules/marquees/item.d.mts +4 -4
- package/dist/components/molecules/marquees/item.d.mts.map +1 -1
- package/dist/components/molecules/marquees/item.mjs +5 -5
- package/dist/components/molecules/marquees/item.mjs.map +1 -1
- package/dist/components/molecules/marquees/marquees.d.mts +2 -2
- package/dist/components/molecules/marquees/marquees.d.mts.map +1 -1
- package/dist/components/molecules/marquees/marquees.mjs +4 -5
- package/dist/components/molecules/marquees/marquees.mjs.map +1 -1
- package/dist/components/molecules/menu/item/item.mjs +1 -1
- package/dist/components/molecules/menu/menu.d.mts +9 -9
- package/dist/components/molecules/menu/menu.d.mts.map +1 -1
- package/dist/components/molecules/menu/menu.mjs +3 -1
- package/dist/components/molecules/menu/menu.mjs.map +1 -1
- package/dist/components/molecules/reveals/item.d.mts +2 -2
- package/dist/components/molecules/reveals/item.d.mts.map +1 -1
- package/dist/components/molecules/reveals/reveals.d.mts +5 -5
- package/dist/components/molecules/reveals/reveals.d.mts.map +1 -1
- package/dist/components/molecules/splitter/index.d.mts.map +1 -1
- package/dist/components/molecules/splitter/panel.d.mts +3 -3
- package/dist/components/molecules/splitter/panel.d.mts.map +1 -1
- package/dist/components/molecules/splitter/splitter.d.mts +3 -3
- package/dist/components/molecules/splitter/splitter.d.mts.map +1 -1
- package/dist/components/molecules/tabs.d.mts +9 -5
- package/dist/components/molecules/tabs.d.mts.map +1 -1
- package/dist/components/molecules/tabs.mjs +5 -1
- package/dist/components/molecules/tabs.mjs.map +1 -1
- package/dist/components/molecules/upload.d.mts +3 -3
- package/dist/components/molecules/upload.d.mts.map +1 -1
- package/dist/components/molecules/upload.mjs +1 -1
- package/dist/components/organisms/drawer.d.mts +3 -3
- package/dist/components/organisms/drawer.d.mts.map +1 -1
- package/dist/components/organisms/drawer.mjs +4 -3
- package/dist/components/organisms/drawer.mjs.map +1 -1
- package/dist/components/organisms/form/context.d.mts +4 -0
- package/dist/components/organisms/form/context.d.mts.map +1 -0
- package/dist/components/organisms/form/context.mjs +9 -0
- package/dist/components/organisms/form/context.mjs.map +1 -0
- package/dist/components/organisms/form/control.d.mts +11 -0
- package/dist/components/organisms/form/control.d.mts.map +1 -0
- package/dist/components/organisms/form/control.mjs +19 -0
- package/dist/components/organisms/form/control.mjs.map +1 -0
- package/dist/components/organisms/form/field.d.mts +25 -0
- package/dist/components/organisms/form/field.d.mts.map +1 -0
- package/dist/components/organisms/form/field.mjs +54 -0
- package/dist/components/organisms/form/field.mjs.map +1 -0
- package/dist/components/organisms/form/form.d.mts +14 -0
- package/dist/components/organisms/form/form.d.mts.map +1 -0
- package/dist/components/organisms/form/form.mjs +23 -0
- package/dist/components/organisms/form/form.mjs.map +1 -0
- package/dist/components/organisms/index.d.mts +14 -6
- package/dist/components/organisms/list/index.d.mts.map +1 -1
- package/dist/components/organisms/list/list.d.mts +2 -2
- package/dist/components/organisms/list/list.d.mts.map +1 -1
- package/dist/components/organisms/modal.d.mts +6 -3
- package/dist/components/organisms/modal.d.mts.map +1 -1
- package/dist/components/organisms/modal.mjs +25 -18
- package/dist/components/organisms/modal.mjs.map +1 -1
- package/dist/components/organisms/swiper/index.d.mts.map +1 -1
- package/dist/components/organisms/swiper/swiper.d.mts +2 -2
- package/dist/components/organisms/swiper/swiper.d.mts.map +1 -1
- package/dist/components/organisms/toast.d.mts +2 -2
- package/dist/components/organisms/toast.d.mts.map +1 -1
- package/dist/components/organisms/toast.mjs +1 -1
- package/dist/components/templates/container.d.mts +2 -2
- package/dist/components/templates/container.d.mts.map +1 -1
- package/dist/components/templates/empty.d.mts +2 -2
- package/dist/components/templates/empty.d.mts.map +1 -1
- package/dist/components/templates/empty.mjs +1 -1
- package/dist/components/templates/grid/col.d.mts +2 -2
- package/dist/components/templates/grid/col.d.mts.map +1 -1
- package/dist/components/templates/grid/row.d.mts +2 -2
- package/dist/components/templates/grid/row.d.mts.map +1 -1
- package/dist/components/templates/layout/content.d.mts +2 -2
- package/dist/components/templates/layout/content.d.mts.map +1 -1
- package/dist/components/templates/layout/footer.d.mts +2 -2
- package/dist/components/templates/layout/footer.d.mts.map +1 -1
- package/dist/components/templates/layout/header.d.mts +2 -2
- package/dist/components/templates/layout/header.d.mts.map +1 -1
- package/dist/components/templates/layout/layout.d.mts +2 -2
- package/dist/components/templates/layout/layout.d.mts.map +1 -1
- package/dist/components/templates/layout/sider.d.mts +2 -2
- package/dist/components/templates/layout/sider.d.mts.map +1 -1
- package/dist/components/templates/layout/sider.mjs +1 -1
- package/dist/components/templates/page-header.d.mts +2 -2
- package/dist/components/templates/page-header.d.mts.map +1 -1
- package/dist/components/templates/page-header.mjs +1 -1
- package/dist/components/templates/result.d.mts +2 -2
- package/dist/components/templates/result.d.mts.map +1 -1
- package/dist/components/templates/result.mjs +1 -1
- package/dist/core/accordion.mjs +1 -1
- package/dist/core/autocomplete.d.mts +2 -0
- package/dist/core/autocomplete.mjs +48 -0
- package/dist/core/autocomplete.mjs.map +1 -0
- package/dist/core/badge.d.mts +5 -3
- package/dist/core/badge.d.mts.map +1 -1
- package/dist/core/button.d.mts +6 -4
- package/dist/core/button.d.mts.map +1 -1
- package/dist/core/calendar.d.mts +13 -3
- package/dist/core/calendar.d.mts.map +1 -0
- package/dist/core/calendar.mjs +1 -1
- package/dist/core/checkbox.mjs +11 -8
- package/dist/core/checkbox.mjs.map +1 -1
- package/dist/core/combobox.d.mts +26 -4
- package/dist/core/combobox.d.mts.map +1 -1
- package/dist/core/combobox.mjs +2 -2
- package/dist/core/combobox.mjs.map +1 -1
- package/dist/core/dialog.mjs +2 -2
- package/dist/core/dialog.mjs.map +1 -1
- package/dist/core/form.d.mts +8 -0
- package/dist/core/form.d.mts.map +1 -0
- package/dist/core/form.mjs +3 -0
- package/dist/core/index.d.mts +13 -9
- package/dist/core/popover.mjs +10 -2
- package/dist/core/popover.mjs.map +1 -1
- package/dist/core/radio-group.mjs +1 -1
- package/dist/core/resizable.d.mts +7 -2
- package/dist/core/resizable.d.mts.map +1 -1
- package/dist/core/resizable.mjs +1 -1
- package/dist/core/scroll-area.d.mts +20 -0
- package/dist/core/scroll-area.d.mts.map +1 -0
- package/dist/core/scroll-area.mjs +57 -0
- package/dist/core/scroll-area.mjs.map +1 -0
- package/dist/core/select.d.mts +24 -2
- package/dist/core/select.d.mts.map +1 -1
- package/dist/core/select.mjs +1 -1
- package/dist/core/separator.d.mts +13 -2
- package/dist/core/separator.d.mts.map +1 -0
- package/dist/core/tabs.d.mts +16 -2
- package/dist/core/tabs.d.mts.map +1 -1
- package/dist/index.d.mts +63 -34
- package/dist/index.mjs +29 -5
- package/dist/lib/colors.d.mts +2 -3
- package/dist/lib/colors.d.mts.map +1 -1
- package/dist/providers/config/context.d.mts +2 -3
- package/dist/providers/config/context.d.mts.map +1 -1
- package/dist/providers/config/context.mjs +3 -1
- package/dist/providers/config/context.mjs.map +1 -1
- package/dist/providers/config/registry.d.mts +2 -3
- package/dist/providers/config/registry.d.mts.map +1 -1
- package/dist/providers/config/types.d.mts +8 -7
- package/dist/providers/config/types.d.mts.map +1 -1
- package/dist/style.css +838 -288
- package/dist/utils.d.mts +2 -3
- package/dist/utils.d.mts.map +1 -1
- package/package.json +147 -26
- package/dist/components/molecules/marquees/use-pause-on-hover.mjs +0 -26
- package/dist/components/molecules/marquees/use-pause-on-hover.mjs.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ComponentSize } from "../../../providers/config/types.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { NumberField, NumberFieldRoot } from "@base-ui/react/number-field";
|
|
4
|
+
//#region src/components/atoms/input/number.d.ts
|
|
5
|
+
export interface Props extends Omit<React$1.ComponentProps<typeof NumberField.Root>, 'children' | 'onValueChange'> {
|
|
6
|
+
/** Visible input label. Alternatively, pair `id` with an external label. */
|
|
7
|
+
label?: string;
|
|
8
|
+
/** Called with the numeric value (or null when cleared). */
|
|
9
|
+
onChange?: (value: number | null, eventDetails: NumberFieldRoot.ChangeEventDetails) => void;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
size?: ComponentSize;
|
|
12
|
+
classNames?: {
|
|
13
|
+
label?: string;
|
|
14
|
+
group?: string;
|
|
15
|
+
input?: string;
|
|
16
|
+
decrement?: string;
|
|
17
|
+
increment?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
declare const Number: ({ ref, id, label, onChange, placeholder, size, className, classNames, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }: Props) => React$1.JSX.Element;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { Number as default };
|
|
23
|
+
//# sourceMappingURL=number.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.d.mts","names":["React"],"sources":["../../../../src/components/atoms/input/number.tsx"],"mappings":";;;;iBAmBiB,cAAc,KAC7BA,QAAM,sBAAsB,YAAY;;EAIxC;;EAEA,YACE,sBACA,cAAc,gBAAgB;EAEhC;EACA,OAAO;EACP;IACE;IACA;IACA;IACA;IACA;;;cAIE,WAAU,KAAA,IAAA,OAAA,UAAA,aAAA,MAAA,WAAA,0BAAA,8BAAA,oCAAA,oBAAA,SAab,UAAKA,QAAA,IAAA"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../../utils.mjs";
|
|
3
|
+
import { useConfig } from "../../../providers/config/context.mjs";
|
|
4
|
+
import Button from "../../../Button.mjs";
|
|
5
|
+
import Input from "./input.mjs";
|
|
6
|
+
import * as React$1 from "react";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { Minus, Plus } from "lucide-react";
|
|
9
|
+
import { NumberField } from "@base-ui/react/number-field";
|
|
10
|
+
//#region src/components/atoms/input/number.tsx
|
|
11
|
+
const sizes = {
|
|
12
|
+
small: "h-8",
|
|
13
|
+
middle: "h-9",
|
|
14
|
+
large: "h-10"
|
|
15
|
+
};
|
|
16
|
+
const Number = ({ ref, id, label, onChange, placeholder, size, className, classNames, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, ...props }) => {
|
|
17
|
+
const generatedId = React$1.useId();
|
|
18
|
+
const inputId = id ?? generatedId;
|
|
19
|
+
const { componentSize } = useConfig();
|
|
20
|
+
const resolvedSize = size ?? componentSize ?? "middle";
|
|
21
|
+
return /* @__PURE__ */ jsxs(NumberField.Root, {
|
|
22
|
+
...props,
|
|
23
|
+
ref,
|
|
24
|
+
id: inputId,
|
|
25
|
+
onValueChange: onChange,
|
|
26
|
+
"data-slot": "input-number",
|
|
27
|
+
className: cn("w-full", className),
|
|
28
|
+
children: [label && /* @__PURE__ */ jsx("label", {
|
|
29
|
+
htmlFor: inputId,
|
|
30
|
+
className: cn("mb-1.5 block text-sm font-medium", classNames?.label),
|
|
31
|
+
children: label
|
|
32
|
+
}), /* @__PURE__ */ jsxs(NumberField.Group, {
|
|
33
|
+
className: cn(`border-input focus-within:border-ring focus-within:ring-ring/50 flex
|
|
34
|
+
w-full items-stretch overflow-hidden rounded-md border shadow-xs
|
|
35
|
+
focus-within:ring-[3px]`, sizes[resolvedSize], classNames?.group),
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx(NumberField.Decrement, {
|
|
38
|
+
"aria-label": "Decrease value",
|
|
39
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
40
|
+
variant: "text",
|
|
41
|
+
size: "small",
|
|
42
|
+
icon: /* @__PURE__ */ jsx(Minus, {}),
|
|
43
|
+
className: cn("h-full! rounded-none px-2!", classNames?.decrement)
|
|
44
|
+
})
|
|
45
|
+
}),
|
|
46
|
+
/* @__PURE__ */ jsx(NumberField.Input, {
|
|
47
|
+
render: /* @__PURE__ */ jsx(Input, {}),
|
|
48
|
+
placeholder,
|
|
49
|
+
"aria-label": ariaLabel,
|
|
50
|
+
"aria-labelledby": ariaLabelledBy,
|
|
51
|
+
"aria-describedby": ariaDescribedBy,
|
|
52
|
+
className: cn(`h-full min-w-0 flex-1 rounded-none border-0 text-center shadow-none
|
|
53
|
+
focus-visible:ring-0`, classNames?.input)
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ jsx(NumberField.Increment, {
|
|
56
|
+
"aria-label": "Increase value",
|
|
57
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
58
|
+
variant: "text",
|
|
59
|
+
size: "small",
|
|
60
|
+
icon: /* @__PURE__ */ jsx(Plus, {}),
|
|
61
|
+
className: cn("h-full! rounded-none px-2!", classNames?.increment)
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { Number as default };
|
|
70
|
+
|
|
71
|
+
//# sourceMappingURL=number.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"number.mjs","names":["React"],"sources":["../../../../src/components/atoms/input/number.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { NumberField, type NumberFieldRoot } from '@base-ui/react/number-field';\nimport { Minus, Plus } from 'lucide-react';\n\nimport { type ComponentSize, useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport Button from '../button';\nimport Input from './input';\n\nconst sizes: Record<ComponentSize, string> = {\n small: 'h-8',\n middle: 'h-9',\n large: 'h-10',\n};\n\nexport interface Props extends Omit<\n React.ComponentProps<typeof NumberField.Root>,\n 'children' | 'onValueChange'\n> {\n /** Visible input label. Alternatively, pair `id` with an external label. */\n label?: string;\n /** Called with the numeric value (or null when cleared). */\n onChange?: (\n value: number | null,\n eventDetails: NumberFieldRoot.ChangeEventDetails,\n ) => void;\n placeholder?: string;\n size?: ComponentSize;\n classNames?: {\n label?: string;\n group?: string;\n input?: string;\n decrement?: string;\n increment?: string;\n };\n}\n\nconst Number = ({\n ref,\n id,\n label,\n onChange,\n placeholder,\n size,\n className,\n classNames,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n 'aria-describedby': ariaDescribedBy,\n ...props\n}: Props) => {\n const generatedId = React.useId();\n const inputId = id ?? generatedId;\n const { componentSize } = useConfig();\n const resolvedSize = size ?? componentSize ?? 'middle';\n\n return (\n <NumberField.Root\n {...props}\n ref={ref}\n id={inputId}\n onValueChange={onChange}\n data-slot=\"input-number\"\n className={cn('w-full', className)}\n >\n {label && (\n <label\n htmlFor={inputId}\n className={cn('mb-1.5 block text-sm font-medium', classNames?.label)}\n >\n {label}\n </label>\n )}\n <NumberField.Group\n className={cn(\n `border-input focus-within:border-ring focus-within:ring-ring/50 flex\n w-full items-stretch overflow-hidden rounded-md border shadow-xs\n focus-within:ring-[3px]`,\n sizes[resolvedSize],\n classNames?.group,\n //\n )}\n >\n <NumberField.Decrement\n aria-label=\"Decrease value\"\n render={\n <Button\n variant=\"text\"\n size=\"small\"\n icon={<Minus />}\n className={cn(\n 'h-full! rounded-none px-2!',\n classNames?.decrement,\n )}\n />\n }\n />\n <NumberField.Input\n render={<Input />}\n placeholder={placeholder}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={ariaDescribedBy}\n className={cn(\n `h-full min-w-0 flex-1 rounded-none border-0 text-center shadow-none\n focus-visible:ring-0`,\n classNames?.input,\n //\n )}\n />\n <NumberField.Increment\n aria-label=\"Increase value\"\n render={\n <Button\n variant=\"text\"\n size=\"small\"\n icon={<Plus />}\n className={cn(\n 'h-full! rounded-none px-2!',\n classNames?.increment,\n )}\n />\n }\n />\n </NumberField.Group>\n </NumberField.Root>\n );\n};\n\nexport default Number;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,QAAuC;CAC3C,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AAwBA,MAAM,UAAU,EACd,KACA,IACA,OACA,UACA,aACA,MACA,WACA,YACA,cAAc,WACd,mBAAmB,gBACnB,oBAAoB,iBACpB,GAAG,YACQ;CACX,MAAM,cAAcA,QAAM,MAAM;CAChC,MAAM,UAAU,MAAM;CACtB,MAAM,EAAE,kBAAkB,UAAU;CACpC,MAAM,eAAe,QAAQ,iBAAiB;CAE9C,OACE,qBAAC,YAAY,MAAb;EACE,GAAI;EACC;EACL,IAAI;EACJ,eAAe;EACf,aAAU;EACV,WAAW,GAAG,UAAU,SAAS;EANnC,UAAA,CAQG,SACC,oBAAC,SAAD;GACE,SAAS;GACT,WAAW,GAAG,oCAAoC,YAAY,KAAK;GAElE,UAAA;EACI,CAAA,GAET,qBAAC,YAAY,OAAb;GACE,WAAW,GACT;;oCAGA,MAAM,eACN,YAAY,KAEd;GARF,UAAA;IAUE,oBAAC,YAAY,WAAb;KACE,cAAW;KACX,QACE,oBAAC,QAAD;MACE,SAAQ;MACR,MAAK;MACL,MAAM,oBAAC,OAAD,CAAQ,CAAA;MACd,WAAW,GACT,8BACA,YAAY,SACd;KACD,CAAA;IAEJ,CAAA;IACD,oBAAC,YAAY,OAAb;KACE,QAAQ,oBAAC,OAAD,CAAQ,CAAA;KACH;KACb,cAAY;KACZ,mBAAiB;KACjB,oBAAkB;KAClB,WAAW,GACT;mCAEA,YAAY,KAEd;IACD,CAAA;IACD,oBAAC,YAAY,WAAb;KACE,cAAW;KACX,QACE,oBAAC,QAAD;MACE,SAAQ;MACR,MAAK;MACL,MAAM,oBAAC,MAAD,CAAO,CAAA;MACb,WAAW,GACT,8BACA,YAAY,SACd;KACD,CAAA;IAEJ,CAAA;GACgB;EACH,CAAA,CAAA;;AAEtB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ComponentSize } from "../../../providers/config/types.mjs";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
|
+
import { OTPField, OTPFieldRoot } from "@base-ui/react/otp-field";
|
|
4
|
+
//#region src/components/atoms/input/otp.d.ts
|
|
5
|
+
export interface Props extends Omit<React$1.ComponentProps<typeof OTPField.Root>, 'children' | 'onValueChange' | 'onValueComplete' | 'autoSubmit' | 'render' | 'className' | 'length'> {
|
|
6
|
+
/** Positive safe integer slot count. Invalid or omitted values use six. */
|
|
7
|
+
length?: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
onChange?: (value: string, details: OTPFieldRoot.ChangeEventDetails) => void;
|
|
11
|
+
onComplete?: (value: string, details: OTPFieldRoot.CompleteEventDetails) => void;
|
|
12
|
+
size?: ComponentSize;
|
|
13
|
+
inputRef?: React$1.Ref<HTMLInputElement>;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
/** Localize the accessible name of each slot after the first. */
|
|
16
|
+
getSlotLabel?: (index: number, length: number) => string;
|
|
17
|
+
classNames?: {
|
|
18
|
+
label?: string;
|
|
19
|
+
group?: string;
|
|
20
|
+
input?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
declare const OTP: ({ label, id, length, size, onChange, onComplete, inputRef, placeholder, getSlotLabel, className, classNames, "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": describedBy, ...props }: Props) => React$1.JSX.Element;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { OTP as default };
|
|
26
|
+
//# sourceMappingURL=otp.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.d.mts","names":["React"],"sources":["../../../../src/components/atoms/input/otp.tsx"],"mappings":";;;;iBAmBiB,cAAc,KAC7BA,QAAM,sBAAsB,SAAS;;EAUrC;EACA;EACA;EACA,YAAY,eAAe,SAAS,aAAa;EACjD,cACE,eACA,SAAS,aAAa;EAExB,OAAO;EACP,WAAWA,QAAM,IAAI;EACrB;;EAEA,gBAAgB,eAAe;EAC/B;IAAe;IAAgB;IAAgB;;;cAG3C,QAAO,OAAA,IAAA,QAAA,MAAA,UAAA,YAAA,UAAA,aAAA,cAAA,WAAA,0BAAA,8BAAA,gCAAA,gBAAA,SAgBV,UAAKA,QAAA,IAAA"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../../utils.mjs";
|
|
3
|
+
import { useConfig } from "../../../providers/config/context.mjs";
|
|
4
|
+
import Input from "./input.mjs";
|
|
5
|
+
import * as React$1 from "react";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { OTPField } from "@base-ui/react/otp-field";
|
|
8
|
+
//#region src/components/atoms/input/otp.tsx
|
|
9
|
+
const sizes = {
|
|
10
|
+
small: "h-8 w-8",
|
|
11
|
+
middle: "h-9 w-9",
|
|
12
|
+
large: "h-10 w-10"
|
|
13
|
+
};
|
|
14
|
+
const OTP = ({ label, id, length = 6, size, onChange, onComplete, inputRef, placeholder, getSlotLabel = (index, count) => `Character ${index + 1} of ${count}`, className, classNames, "aria-label": ariaLabel, "aria-labelledby": labelledBy, "aria-describedby": describedBy, ...props }) => {
|
|
15
|
+
const generatedId = React$1.useId();
|
|
16
|
+
const inputId = id ?? generatedId;
|
|
17
|
+
const { componentSize } = useConfig();
|
|
18
|
+
const isValidLength = Number.isSafeInteger(length) && length > 0;
|
|
19
|
+
const count = isValidLength ? length : 6;
|
|
20
|
+
React$1.useEffect(() => {
|
|
21
|
+
if (process.env.NODE_ENV !== "production" && !isValidLength) console.warn("Input.OTP length must be a positive safe integer; using six.");
|
|
22
|
+
}, [isValidLength, length]);
|
|
23
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
24
|
+
"data-slot": "input-otp",
|
|
25
|
+
children: [label && /* @__PURE__ */ jsx("label", {
|
|
26
|
+
htmlFor: inputId,
|
|
27
|
+
className: cn("mb-1.5 block text-sm font-medium", classNames?.label),
|
|
28
|
+
children: label
|
|
29
|
+
}), /* @__PURE__ */ jsx(OTPField.Root, {
|
|
30
|
+
...props,
|
|
31
|
+
id: inputId,
|
|
32
|
+
length: count,
|
|
33
|
+
autoSubmit: false,
|
|
34
|
+
onValueChange: onChange,
|
|
35
|
+
onValueComplete: onComplete,
|
|
36
|
+
"aria-describedby": describedBy,
|
|
37
|
+
className: cn("flex flex-wrap gap-2", classNames?.group, className),
|
|
38
|
+
children: Array.from({ length: count }, (_, index) => /* @__PURE__ */ jsx(OTPField.Input, {
|
|
39
|
+
ref: index === 0 ? inputRef : void 0,
|
|
40
|
+
render: /* @__PURE__ */ jsx(Input, {}),
|
|
41
|
+
placeholder,
|
|
42
|
+
"aria-label": index === 0 ? ariaLabel : getSlotLabel(index, count),
|
|
43
|
+
"aria-labelledby": index === 0 ? labelledBy : void 0,
|
|
44
|
+
className: cn("shrink-0 px-0 text-center tabular-nums", sizes[size ?? componentSize ?? "middle"], classNames?.input)
|
|
45
|
+
}, index))
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
//#endregion
|
|
50
|
+
export { OTP as default };
|
|
51
|
+
|
|
52
|
+
//# sourceMappingURL=otp.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otp.mjs","names":["React"],"sources":["../../../../src/components/atoms/input/otp.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\n\nimport { OTPField, type OTPFieldRoot } from '@base-ui/react/otp-field';\n\nimport { type ComponentSize, useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport Input from './input';\n\ndeclare const process: { env: { NODE_ENV?: string } };\n\nconst sizes: Record<ComponentSize, string> = {\n small: 'h-8 w-8',\n middle: 'h-9 w-9',\n large: 'h-10 w-10',\n};\n\nexport interface Props extends Omit<\n React.ComponentProps<typeof OTPField.Root>,\n | 'children'\n | 'onValueChange'\n | 'onValueComplete'\n | 'autoSubmit'\n | 'render'\n | 'className'\n | 'length'\n> {\n /** Positive safe integer slot count. Invalid or omitted values use six. */\n length?: number;\n className?: string;\n label?: string;\n onChange?: (value: string, details: OTPFieldRoot.ChangeEventDetails) => void;\n onComplete?: (\n value: string,\n details: OTPFieldRoot.CompleteEventDetails,\n ) => void;\n size?: ComponentSize;\n inputRef?: React.Ref<HTMLInputElement>;\n placeholder?: string;\n /** Localize the accessible name of each slot after the first. */\n getSlotLabel?: (index: number, length: number) => string;\n classNames?: { label?: string; group?: string; input?: string };\n}\n\nconst OTP = ({\n label,\n id,\n length = 6,\n size,\n onChange,\n onComplete,\n inputRef,\n placeholder,\n getSlotLabel = (index, count) => `Character ${index + 1} of ${count}`,\n className,\n classNames,\n 'aria-label': ariaLabel,\n 'aria-labelledby': labelledBy,\n 'aria-describedby': describedBy,\n ...props\n}: Props) => {\n const generatedId = React.useId();\n const inputId = id ?? generatedId;\n const { componentSize } = useConfig();\n const isValidLength = Number.isSafeInteger(length) && length > 0;\n const count = isValidLength ? length : 6;\n\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && !isValidLength) {\n console.warn(\n 'Input.OTP length must be a positive safe integer; using six.',\n );\n }\n }, [isValidLength, length]);\n\n return (\n <div data-slot=\"input-otp\">\n {label && (\n <label\n htmlFor={inputId}\n className={cn(\n 'mb-1.5 block text-sm font-medium',\n classNames?.label,\n //\n )}\n >\n {label}\n </label>\n )}\n <OTPField.Root\n {...props}\n id={inputId}\n length={count}\n autoSubmit={false}\n onValueChange={onChange}\n onValueComplete={onComplete}\n aria-describedby={describedBy}\n className={cn(\n 'flex flex-wrap gap-2',\n classNames?.group,\n className,\n //\n )}\n >\n {Array.from({ length: count }, (_, index) => (\n <OTPField.Input\n key={index}\n ref={index === 0 ? inputRef : undefined}\n render={<Input />}\n placeholder={placeholder}\n aria-label={index === 0 ? ariaLabel : getSlotLabel(index, count)}\n aria-labelledby={index === 0 ? labelledBy : undefined}\n className={cn(\n 'shrink-0 px-0 text-center tabular-nums',\n sizes[size ?? componentSize ?? 'middle'],\n classNames?.input,\n //\n )}\n />\n ))}\n </OTPField.Root>\n </div>\n );\n};\nexport default OTP;\n"],"mappings":";;;;;;;;AAaA,MAAM,QAAuC;CAC3C,OAAO;CACP,QAAQ;CACR,OAAO;AACT;AA6BA,MAAM,OAAO,EACX,OACA,IACA,SAAS,GACT,MACA,UACA,YACA,UACA,aACA,gBAAgB,OAAO,UAAU,aAAa,QAAQ,EAAE,MAAM,SAC9D,WACA,YACA,cAAc,WACd,mBAAmB,YACnB,oBAAoB,aACpB,GAAG,YACQ;CACX,MAAM,cAAcA,QAAM,MAAM;CAChC,MAAM,UAAU,MAAM;CACtB,MAAM,EAAE,kBAAkB,UAAU;CACpC,MAAM,gBAAgB,OAAO,cAAc,MAAM,KAAK,SAAS;CAC/D,MAAM,QAAQ,gBAAgB,SAAS;CAEvC,QAAM,gBAAgB;EACpB,IAAI,QAAQ,IAAI,aAAa,gBAAgB,CAAC,eAC5C,QAAQ,KACN,8DACF;CAEJ,GAAG,CAAC,eAAe,MAAM,CAAC;CAE1B,OACE,qBAAC,OAAD;EAAK,aAAU;EAAf,UAAA,CACG,SACC,oBAAC,SAAD;GACE,SAAS;GACT,WAAW,GACT,oCACA,YAAY,KAEd;GAEC,UAAA;EACI,CAAA,GAET,oBAAC,SAAS,MAAV;GACE,GAAI;GACJ,IAAI;GACJ,QAAQ;GACR,YAAY;GACZ,eAAe;GACf,iBAAiB;GACjB,oBAAkB;GAClB,WAAW,GACT,wBACA,YAAY,OACZ,SAEF;GAEC,UAAA,MAAM,KAAK,EAAE,QAAQ,MAAM,IAAI,GAAG,UACjC,oBAAC,SAAS,OAAV;IAEE,KAAK,UAAU,IAAI,WAAW,KAAA;IAC9B,QAAQ,oBAAC,OAAD,CAAQ,CAAA;IACH;IACb,cAAY,UAAU,IAAI,YAAY,aAAa,OAAO,KAAK;IAC/D,mBAAiB,UAAU,IAAI,aAAa,KAAA;IAC5C,WAAW,GACT,0CACA,MAAM,QAAQ,iBAAiB,WAC/B,YAAY,KAEd;GACD,GAZM,KAYN,CACF;EACY,CAAA,CACZ;;AAET"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
//#region src/components/atoms/input/search.d.ts
|
|
2
|
-
interface Props extends React.ComponentPropsWithRef<'input'> {
|
|
2
|
+
export interface Props extends React.ComponentPropsWithRef<'input'> {
|
|
3
3
|
allowClear?: boolean;
|
|
4
|
-
onChange?: (e: React.ChangeEvent<HTMLInputElement> | {
|
|
5
|
-
target: {
|
|
6
|
-
value: string;
|
|
7
|
-
};
|
|
8
|
-
}) => void;
|
|
9
4
|
onSearch?: (value: string) => void;
|
|
10
5
|
}
|
|
11
6
|
declare const Search: {
|
|
@@ -13,5 +8,5 @@ declare const Search: {
|
|
|
13
8
|
displayName: string;
|
|
14
9
|
};
|
|
15
10
|
//#endregion
|
|
16
|
-
export {
|
|
11
|
+
export { Search as default };
|
|
17
12
|
//# sourceMappingURL=search.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.mts","names":[],"sources":["../../../../src/components/atoms/input/search.tsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"search.d.mts","names":[],"sources":["../../../../src/components/atoms/input/search.tsx"],"mappings":";iBAeiB,cAAc,MAAM;EACnC;EACA,YAAY;;cAGR;KAWH,KAAA,WAAA,cAAA,OAAA,UAAA,YAAA,UAAA,WAAA,YAAA,UAAA,cAAA,SAAA,wBAAK,IAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
3
|
import { DEFAULT_LOCALE, useConfig } from "../../../providers/config/context.mjs";
|
|
4
|
-
import { input_exports } from "../../../core/input.mjs";
|
|
5
4
|
import Button from "../../../Button.mjs";
|
|
5
|
+
import { input_exports } from "../../../core/input.mjs";
|
|
6
6
|
import { useRef, useState } from "react";
|
|
7
|
-
import { CircleX, Search } from "lucide-react";
|
|
8
7
|
import { useMergedRef } from "@jbpark/use-hooks";
|
|
9
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { CircleX, Search } from "lucide-react";
|
|
10
10
|
//#region src/components/atoms/input/search.tsx
|
|
11
11
|
const { Input: Core } = input_exports;
|
|
12
12
|
const Search$1 = ({ ref, className, defaultValue, value, disabled, allowClear = true, onChange, onKeyDown: _onKeyDown, onSearch: _onSearch, ...props }) => {
|
|
@@ -16,12 +16,10 @@ const Search$1 = ({ ref, className, defaultValue, value, disabled, allowClear =
|
|
|
16
16
|
const [uncontrolledHasValue, setUncontrolledHasValue] = useState(!!defaultValue);
|
|
17
17
|
const hasValue = value !== void 0 ? !!value : uncontrolledHasValue;
|
|
18
18
|
const onClear = () => {
|
|
19
|
-
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
onChange?.({ target: { value: "" } });
|
|
19
|
+
const input = inputRef.current;
|
|
20
|
+
if (!input) return;
|
|
21
|
+
(Object.getOwnPropertyDescriptor(Object.getPrototypeOf(input), "value")?.set)?.call(input, "");
|
|
22
|
+
input.dispatchEvent(new Event("input", { bubbles: true }));
|
|
25
23
|
};
|
|
26
24
|
const onSearch = () => {
|
|
27
25
|
if (disabled) return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.mjs","names":["input","Search","SearchOutlined"],"sources":["../../../../src/components/atoms/input/search.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\n\nimport { useMergedRef } from '@jbpark/use-hooks';\nimport { CircleX, Search as SearchOutlined } from 'lucide-react';\n\nimport { DEFAULT_LOCALE, useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { input } from '../../../core';\nimport Button from '../button';\n\nconst { Input: Core } = input;\n\nexport interface Props extends React.ComponentPropsWithRef<'input'> {\n allowClear?: boolean;\n
|
|
1
|
+
{"version":3,"file":"search.mjs","names":["input","Search","SearchOutlined"],"sources":["../../../../src/components/atoms/input/search.tsx"],"sourcesContent":["'use client';\n\nimport { useRef, useState } from 'react';\n\nimport { useMergedRef } from '@jbpark/use-hooks';\nimport { CircleX, Search as SearchOutlined } from 'lucide-react';\n\nimport { DEFAULT_LOCALE, useConfig } from '@repo/ui/providers';\nimport { cn } from '@repo/ui/utils';\n\nimport { input } from '../../../core';\nimport Button from '../button';\n\nconst { Input: Core } = input;\n\nexport interface Props extends React.ComponentPropsWithRef<'input'> {\n allowClear?: boolean;\n onSearch?: (value: string) => void;\n}\n\nconst Search = ({\n ref,\n className,\n defaultValue,\n value,\n disabled,\n allowClear = true,\n onChange,\n onKeyDown: _onKeyDown,\n onSearch: _onSearch,\n ...props\n}: Props) => {\n const { locale } = useConfig();\n const inputRef = useRef<HTMLInputElement>(null);\n\n const mergedRef = useMergedRef(inputRef, ref);\n\n const [uncontrolledHasValue, setUncontrolledHasValue] =\n useState(!!defaultValue);\n const hasValue = value !== undefined ? !!value : uncontrolledHasValue;\n\n const onClear = () => {\n const input = inputRef.current;\n\n if (!input) {\n return;\n }\n\n // Use the native setter so React detects the value change and emits the\n // same ChangeEvent as typing, including for controlled inputs.\n const setter = Object.getOwnPropertyDescriptor(\n Object.getPrototypeOf(input),\n 'value',\n )?.set;\n\n setter?.call(input, '');\n input.dispatchEvent(new Event('input', { bubbles: true }));\n };\n\n const onSearch = () => {\n if (disabled) {\n return;\n }\n if (inputRef.current) {\n _onSearch?.(inputRef.current.value);\n }\n };\n\n return (\n <div\n data-slot=\"input-search\"\n className={cn(\n 'flex items-center',\n 'rounded-md',\n className,\n //\n )}\n >\n <div\n className={cn(\n 'relative grow',\n 'inline-flex items-center',\n //\n )}\n >\n <Core\n {...props}\n ref={mergedRef}\n inputMode=\"search\"\n type=\"search\"\n enterKeyHint=\"search\"\n disabled={disabled}\n className={cn(\n 'rounded-r-none',\n '[&::-webkit-search-cancel-button]:hidden',\n '[&::-webkit-search-decoration]:hidden',\n //\n )}\n value={value}\n defaultValue={defaultValue}\n onChange={e => {\n if (value === undefined) {\n setUncontrolledHasValue(!!e.target.value);\n }\n onChange?.(e);\n }}\n onKeyDown={e => {\n _onKeyDown?.(e);\n if (e.key === 'Enter') {\n onSearch();\n }\n }}\n />\n <button\n type=\"button\"\n data-slot=\"input-search-clear\"\n aria-label={locale.clear ?? DEFAULT_LOCALE.clear}\n disabled={disabled}\n className={cn(\n 'absolute right-2',\n 'shrink-0 cursor-pointer',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n (!allowClear || !hasValue) && 'hidden',\n )}\n onClick={onClear}\n >\n <CircleX className=\"size-4\" />\n </button>\n </div>\n <Button\n icon={<SearchOutlined />}\n disabled={disabled}\n className={cn(\n 'rounded-l-none',\n 'size-9',\n //\n )}\n onClick={onSearch}\n />\n </div>\n );\n};\n\nSearch.displayName = 'Search';\n\nexport default Search;\n"],"mappings":";;;;;;;;;;AAaA,MAAM,EAAE,OAAO,SAASA;AAOxB,MAAMC,YAAU,EACd,KACA,WACA,cACA,OACA,UACA,aAAa,MACb,UACA,WAAW,YACX,UAAU,WACV,GAAG,YACQ;CACX,MAAM,EAAE,WAAW,UAAU;CAC7B,MAAM,WAAW,OAAyB,IAAI;CAE9C,MAAM,YAAY,aAAa,UAAU,GAAG;CAE5C,MAAM,CAAC,sBAAsB,2BAC3B,SAAS,CAAC,CAAC,YAAY;CACzB,MAAM,WAAW,UAAU,KAAA,IAAY,CAAC,CAAC,QAAQ;CAEjD,MAAM,gBAAgB;EACpB,MAAM,QAAQ,SAAS;EAEvB,IAAI,CAAC,OACH;EAUF,CALe,OAAO,yBACpB,OAAO,eAAe,KAAK,GAC3B,OACF,CAAC,EAAE,IAAA,EAEK,KAAK,OAAO,EAAE;EACtB,MAAM,cAAc,IAAI,MAAM,SAAS,EAAE,SAAS,KAAK,CAAC,CAAC;CAC3D;CAEA,MAAM,iBAAiB;EACrB,IAAI,UACF;EAEF,IAAI,SAAS,SACX,YAAY,SAAS,QAAQ,KAAK;CAEtC;CAEA,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,qBACA,cACA,SAEF;EAPF,UAAA,CASE,qBAAC,OAAD;GACE,WAAW,GACT,iBACA,0BAEF;GALF,UAAA,CAOE,oBAAC,MAAD;IACE,GAAI;IACJ,KAAK;IACL,WAAU;IACV,MAAK;IACL,cAAa;IACH;IACV,WAAW,GACT,kBACA,4CACA,uCAEF;IACO;IACO;IACd,WAAU,MAAK;KACb,IAAI,UAAU,KAAA,GACZ,wBAAwB,CAAC,CAAC,EAAE,OAAO,KAAK;KAE1C,WAAW,CAAC;IACd;IACA,YAAW,MAAK;KACd,aAAa,CAAC;KACd,IAAI,EAAE,QAAQ,SACZ,SAAS;IAEb;GACD,CAAA,GACD,oBAAC,UAAD;IACE,MAAK;IACL,aAAU;IACV,cAAY,OAAO,SAAS,eAAe;IACjC;IACV,WAAW,GACT,oBACA,2BACA,oDACC,CAAC,cAAc,CAAC,aAAa,QAChC;IACA,SAAS;IAET,UAAA,oBAAC,SAAD,EAAS,WAAU,SAAU,CAAA;GACvB,CAAA,CACL;EACL,CAAA,GAAA,oBAAC,QAAD;GACE,MAAM,oBAACC,QAAD,CAAiB,CAAA;GACb;GACV,WAAW,GACT,kBACA,QAEF;GACA,SAAS;EACV,CAAA,CACE;;AAET;AAEA,SAAO,cAAc"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
//#region src/components/atoms/mentions-token.ts
|
|
2
|
+
function findToken(text, start, end, prefixes) {
|
|
3
|
+
if (start < 0 || end < start || end > text.length) return null;
|
|
4
|
+
let boundary = start;
|
|
5
|
+
while (boundary > 0 && !/\s/u.test(text[boundary - 1])) boundary -= 1;
|
|
6
|
+
const beforeCaret = text.slice(boundary, start);
|
|
7
|
+
const prefix = prefixes.filter((candidate) => candidate.length > 0 && !/\s/u.test(candidate)).sort((a, b) => b.length - a.length).find((candidate) => beforeCaret.startsWith(candidate));
|
|
8
|
+
if (!prefix) return null;
|
|
9
|
+
let tokenEnd = start;
|
|
10
|
+
while (tokenEnd < text.length && !/\s/u.test(text[tokenEnd])) tokenEnd += 1;
|
|
11
|
+
if (end > tokenEnd) return null;
|
|
12
|
+
return {
|
|
13
|
+
start: boundary,
|
|
14
|
+
end: tokenEnd,
|
|
15
|
+
prefix,
|
|
16
|
+
query: beforeCaret.slice(prefix.length)
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function insertToken(text, token, value) {
|
|
20
|
+
const mention = token.prefix + value;
|
|
21
|
+
const tail = text.slice(token.end);
|
|
22
|
+
const separator = tail.length === 0 || !/^\s/u.test(tail) ? " " : "";
|
|
23
|
+
return {
|
|
24
|
+
value: text.slice(0, token.start) + mention + separator + tail,
|
|
25
|
+
caret: token.start + mention.length + separator.length
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { findToken, insertToken };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=mentions-token.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mentions-token.mjs","names":[],"sources":["../../../src/components/atoms/mentions-token.ts"],"sourcesContent":["export interface Token {\n start: number;\n end: number;\n prefix: string;\n query: string;\n}\n\nexport function findToken(\n text: string,\n start: number,\n end: number,\n prefixes: readonly string[],\n): Token | null {\n if (start < 0 || end < start || end > text.length) {\n return null;\n }\n\n let boundary = start;\n\n while (boundary > 0 && !/\\s/u.test(text[boundary - 1]!)) {\n boundary -= 1;\n }\n\n const beforeCaret = text.slice(boundary, start);\n const prefix = prefixes\n .filter(candidate => candidate.length > 0 && !/\\s/u.test(candidate))\n .sort((a, b) => b.length - a.length)\n .find(candidate => beforeCaret.startsWith(candidate));\n\n if (!prefix) {\n return null;\n }\n\n let tokenEnd = start;\n\n while (tokenEnd < text.length && !/\\s/u.test(text[tokenEnd]!)) {\n tokenEnd += 1;\n }\n\n if (end > tokenEnd) {\n return null;\n }\n\n return {\n start: boundary,\n end: tokenEnd,\n prefix,\n query: beforeCaret.slice(prefix.length),\n };\n}\n\nexport function insertToken(text: string, token: Token, value: string) {\n const mention = token.prefix + value;\n const tail = text.slice(token.end);\n const separator = tail.length === 0 || !/^\\s/u.test(tail) ? ' ' : '';\n\n return {\n value: text.slice(0, token.start) + mention + separator + tail,\n caret: token.start + mention.length + separator.length,\n };\n}\n"],"mappings":";AAOA,SAAgB,UACd,MACA,OACA,KACA,UACc;CACd,IAAI,QAAQ,KAAK,MAAM,SAAS,MAAM,KAAK,QACzC,OAAO;CAGT,IAAI,WAAW;CAEf,OAAO,WAAW,KAAK,CAAC,MAAM,KAAK,KAAK,WAAW,EAAG,GACpD,YAAY;CAGd,MAAM,cAAc,KAAK,MAAM,UAAU,KAAK;CAC9C,MAAM,SAAS,SACZ,QAAO,cAAa,UAAU,SAAS,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CACnE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CACnC,MAAK,cAAa,YAAY,WAAW,SAAS,CAAC;CAEtD,IAAI,CAAC,QACH,OAAO;CAGT,IAAI,WAAW;CAEf,OAAO,WAAW,KAAK,UAAU,CAAC,MAAM,KAAK,KAAK,SAAU,GAC1D,YAAY;CAGd,IAAI,MAAM,UACR,OAAO;CAGT,OAAO;EACL,OAAO;EACP,KAAK;EACL;EACA,OAAO,YAAY,MAAM,OAAO,MAAM;CACxC;AACF;AAEA,SAAgB,YAAY,MAAc,OAAc,OAAe;CACrE,MAAM,UAAU,MAAM,SAAS;CAC/B,MAAM,OAAO,KAAK,MAAM,MAAM,GAAG;CACjC,MAAM,YAAY,KAAK,WAAW,KAAK,CAAC,OAAO,KAAK,IAAI,IAAI,MAAM;CAElE,OAAO;EACL,OAAO,KAAK,MAAM,GAAG,MAAM,KAAK,IAAI,UAAU,YAAY;EAC1D,OAAO,MAAM,QAAQ,QAAQ,SAAS,UAAU;CAClD;AACF"}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
//#region src/components/atoms/option-group.d.ts
|
|
2
|
-
type OptionValue = string | number | boolean;
|
|
3
|
-
interface Option {
|
|
2
|
+
export type OptionValue = string | number | boolean;
|
|
3
|
+
export interface Option {
|
|
4
4
|
label: string;
|
|
5
5
|
value: OptionValue;
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
}
|
|
8
|
-
type Options = string[] | number[] | boolean[] | Option[];
|
|
9
|
-
interface OptionGroupClassNames {
|
|
8
|
+
export type Options = string[] | number[] | boolean[] | Option[];
|
|
9
|
+
export interface OptionGroupClassNames {
|
|
10
10
|
wrapper?: string;
|
|
11
11
|
item?: string;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
-
export { Option, OptionGroupClassNames, OptionValue, Options };
|
|
15
14
|
//# sourceMappingURL=option-group.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"option-group.d.mts","names":[],"sources":["../../../src/components/atoms/option-group.ts"],"mappings":";
|
|
1
|
+
{"version":3,"file":"option-group.d.mts","names":[],"sources":["../../../src/components/atoms/option-group.ts"],"mappings":";YAAY;iBAEK;EACf;EACA,OAAO;EACP;;YAGU,4CAA4C;iBAEvC;EACf;EACA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/components/atoms/popover.d.ts
|
|
2
2
|
type Placement = 'top' | 'left' | 'right' | 'bottom' | 'topLeft' | 'topRight' | 'bottomLeft' | 'bottomRight' | 'leftTop' | 'leftBottom' | 'rightTop' | 'rightBottom';
|
|
3
|
-
interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title' | 'content'> {
|
|
3
|
+
export interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title' | 'content'> {
|
|
4
4
|
title?: React.ReactNode;
|
|
5
5
|
/** Set to false when a custom trigger component renders a non-button element. */
|
|
6
6
|
nativeButton?: boolean;
|
|
@@ -12,5 +12,5 @@ interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'title' | 'c
|
|
|
12
12
|
}
|
|
13
13
|
declare const Popover: ({ title, nativeButton, placement, className, content, children, open: _open, defaultOpen, onOpenChange, ...props }: Props) => import("react").JSX.Element;
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
15
|
+
export { Popover as default };
|
|
16
16
|
//# sourceMappingURL=popover.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.mts","names":[],"sources":["../../../src/components/atoms/popover.tsx"],"mappings":";KAmBK;
|
|
1
|
+
{"version":3,"file":"popover.d.mts","names":[],"sources":["../../../src/components/atoms/popover.tsx"],"mappings":";KAmBK;iBAcY,cAAc,KAC7B,MAAM;EAGN,QAAQ,MAAM;;EAEd;EACA,YAAY;EACZ,SAAS,MAAM;EACf;EACA;EACA,gBAAgB;;cAqBZ,YAAW,OAAA,cAAA,WAAA,WAAA,SAAA,UAAA,MAAA,OAAA,aAAA,iBAAA,SAWd,0BAAK,IAAA"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
//#region src/components/atoms/progress.d.ts
|
|
2
|
-
interface Props extends React.ComponentPropsWithoutRef<'div'> {
|
|
2
|
+
export interface Props extends React.ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
value: number;
|
|
4
|
+
orientation?: 'horizontal' | 'vertical';
|
|
5
|
+
/** @deprecated Use `orientation`. */
|
|
4
6
|
direction?: 'horizontal' | 'vertical';
|
|
5
7
|
classNames?: {
|
|
6
8
|
background?: string;
|
|
7
9
|
bar?: string;
|
|
8
10
|
};
|
|
9
11
|
}
|
|
10
|
-
declare const Progress: ({ value, className, direction, classNames, ...props }: Props) => import("react").JSX.Element;
|
|
12
|
+
declare const Progress: ({ value, className, orientation, direction, classNames, ...props }: Props) => import("react").JSX.Element;
|
|
11
13
|
//#endregion
|
|
12
|
-
export {
|
|
14
|
+
export { Progress as default };
|
|
13
15
|
//# sourceMappingURL=progress.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.mts","names":[],"sources":["../../../src/components/atoms/progress.tsx"],"mappings":";
|
|
1
|
+
{"version":3,"file":"progress.d.mts","names":[],"sources":["../../../src/components/atoms/progress.tsx"],"mappings":";iBAMiB,cAAc,MAAM;EACnC;EACA;;EAEA;EACA;IACE;IACA;;;cAIE,aAAY,OAAA,WAAA,aAAA,WAAA,eAAA,SAOf,0BAAK,IAAA"}
|
|
@@ -3,8 +3,8 @@ import { progress_exports } from "../../core/progress.mjs";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
//#region src/components/atoms/progress.tsx
|
|
5
5
|
const { Progress: Core } = progress_exports;
|
|
6
|
-
const Progress = ({ value, className, direction = "horizontal", classNames, ...props }) => {
|
|
7
|
-
const isHorizontal = direction === "horizontal";
|
|
6
|
+
const Progress = ({ value, className, orientation, direction = "horizontal", classNames, ...props }) => {
|
|
7
|
+
const isHorizontal = (orientation ?? direction) === "horizontal";
|
|
8
8
|
const normalizedValue = Number.isFinite(value) ? Math.min(100, Math.max(0, value)) : 0;
|
|
9
9
|
return /* @__PURE__ */ jsx(Core, {
|
|
10
10
|
...props,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.mjs","names":["progress"],"sources":["../../../src/components/atoms/progress.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nimport { progress } from '../../core';\n\nconst { Progress: Core } = progress;\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {\n value: number;\n direction?: 'horizontal' | 'vertical';\n classNames?: {\n background?: string;\n bar?: string;\n };\n}\n\nconst Progress = ({\n value,\n className,\n direction = 'horizontal',\n classNames,\n ...props\n}: Props) => {\n const isHorizontal = direction === 'horizontal';\n const normalizedValue = Number.isFinite(value)\n ? Math.min(100, Math.max(0, value))\n : 0;\n\n return (\n <Core\n {...props}\n value={normalizedValue}\n className={cn(\n isHorizontal ? 'h-4 w-full' : 'flex h-full w-4 flex-col justify-end',\n className,\n classNames?.background,\n //\n )}\n barClassName={cn('flex-none', classNames?.bar)}\n barStyle={\n isHorizontal\n ? { width: `${normalizedValue}%` }\n : { width: '100%', height: `${normalizedValue}%` }\n }\n />\n );\n};\n\nexport default Progress;\n"],"mappings":";;;;AAIA,MAAM,EAAE,UAAU,SAASA;
|
|
1
|
+
{"version":3,"file":"progress.mjs","names":["progress"],"sources":["../../../src/components/atoms/progress.tsx"],"sourcesContent":["import { cn } from '@repo/ui/utils';\n\nimport { progress } from '../../core';\n\nconst { Progress: Core } = progress;\n\nexport interface Props extends React.ComponentPropsWithoutRef<'div'> {\n value: number;\n orientation?: 'horizontal' | 'vertical';\n /** @deprecated Use `orientation`. */\n direction?: 'horizontal' | 'vertical';\n classNames?: {\n background?: string;\n bar?: string;\n };\n}\n\nconst Progress = ({\n value,\n className,\n orientation,\n direction = 'horizontal',\n classNames,\n ...props\n}: Props) => {\n const isHorizontal = (orientation ?? direction) === 'horizontal';\n const normalizedValue = Number.isFinite(value)\n ? Math.min(100, Math.max(0, value))\n : 0;\n\n return (\n <Core\n {...props}\n value={normalizedValue}\n className={cn(\n isHorizontal ? 'h-4 w-full' : 'flex h-full w-4 flex-col justify-end',\n className,\n classNames?.background,\n //\n )}\n barClassName={cn('flex-none', classNames?.bar)}\n barStyle={\n isHorizontal\n ? { width: `${normalizedValue}%` }\n : { width: '100%', height: `${normalizedValue}%` }\n }\n />\n );\n};\n\nexport default Progress;\n"],"mappings":";;;;AAIA,MAAM,EAAE,UAAU,SAASA;AAa3B,MAAM,YAAY,EAChB,OACA,WACA,aACA,YAAY,cACZ,YACA,GAAG,YACQ;CACX,MAAM,gBAAgB,eAAe,eAAe;CACpD,MAAM,kBAAkB,OAAO,SAAS,KAAK,IACzC,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,KAAK,CAAC,IAChC;CAEJ,OACE,oBAAC,MAAD;EACE,GAAI;EACJ,OAAO;EACP,WAAW,GACT,eAAe,eAAe,wCAC9B,WACA,YAAY,UAEd;EACA,cAAc,GAAG,aAAa,YAAY,GAAG;EAC7C,UACE,eACI,EAAE,OAAO,GAAG,gBAAgB,GAAG,IAC/B;GAAE,OAAO;GAAQ,QAAQ,GAAG,gBAAgB;EAAG;CAEtD,CAAA;AAEL"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OptionGroupClassNames, OptionValue, Options } from "../option-group.mjs";
|
|
2
2
|
//#region src/components/atoms/radio/group.d.ts
|
|
3
|
-
interface Props extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'onChange' | 'defaultValue' | 'value'> {
|
|
3
|
+
export interface Props extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'onChange' | 'defaultValue' | 'value'> {
|
|
4
4
|
options?: Options;
|
|
5
5
|
orientation?: 'vertical' | 'horizontal';
|
|
6
6
|
placement?: 'left' | 'right';
|
|
@@ -17,5 +17,5 @@ interface Props extends Omit<React.ComponentPropsWithoutRef<'ul'>, 'onChange' |
|
|
|
17
17
|
}
|
|
18
18
|
declare const RadioGroup: ({ orientation, placement, className, classNames, options: _options, name, optionType, buttonStyle, size, disabled, defaultValue, value: _value, onChange: _onChange, ...props }: Props) => import("react").JSX.Element;
|
|
19
19
|
//#endregion
|
|
20
|
-
export { type OptionValue,
|
|
20
|
+
export { type OptionValue, RadioGroup as default };
|
|
21
21
|
//# sourceMappingURL=group.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group.d.mts","names":[],"sources":["../../../../src/components/atoms/radio/group.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"group.d.mts","names":[],"sources":["../../../../src/components/atoms/radio/group.tsx"],"mappings":";;iBA0BiB,cAAc,KAC7B,MAAM;EAGN,UAAU;EACV;EACA;EACA,aAAa;EACb,eAAe;EACf,QAAQ;;EAER;EACA;EACA;EACA;EACA;EACA,YAAY,OAAO;;cAGf,eAAc,aAAA,WAAA,WAAA,YAAA,SAAA,UAAA,MAAA,YAAA,aAAA,MAAA,UAAA,cAAA,OAAA,QAAA,UAAA,cAAA,SAejB,0BAAK,IAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../utils.mjs";
|
|
3
|
-
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
4
3
|
import Button from "../../../Button.mjs";
|
|
4
|
+
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
5
5
|
import { normalizeOptions, warnOnDuplicateOptionValues } from "../option-group.mjs";
|
|
6
6
|
import { RadioGroupContext } from "./context.mjs";
|
|
7
7
|
import Radio$1 from "./radio.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../../../src/components/atoms/radio/index.ts"],"mappings":";;;KAGK,
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":["RadioImpl","Group"],"sources":["../../../../src/components/atoms/radio/index.ts"],"mappings":";;;KAGK,wBAAwBA;EAAc,cAAcC;;cAEnD,OAAqB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OptionValue } from "../option-group.mjs";
|
|
2
2
|
//#region src/components/atoms/radio/radio.d.ts
|
|
3
|
-
interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
3
|
+
export interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'> {
|
|
4
4
|
placement?: 'left' | 'right';
|
|
5
5
|
defaultChecked?: boolean;
|
|
6
6
|
checked?: boolean;
|
|
@@ -22,5 +22,5 @@ interface Props extends Omit<React.ComponentPropsWithoutRef<'div'>, 'onChange'>
|
|
|
22
22
|
}
|
|
23
23
|
declare const Radio: ({ placement, value: _value, children, className, icons, disabled, defaultChecked, checked: _checked, id: _id, name, onChange: _onChange, ...props }: Props) => import("react").JSX.Element;
|
|
24
24
|
//#endregion
|
|
25
|
-
export {
|
|
25
|
+
export { Radio as default };
|
|
26
26
|
//# sourceMappingURL=radio.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.d.mts","names":[],"sources":["../../../../src/components/atoms/radio/radio.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"radio.d.mts","names":[],"sources":["../../../../src/components/atoms/radio/radio.tsx"],"mappings":";;iBAoBiB,cAAc,KAC7B,MAAM;EAGN;EACA;EACA;EACA,QAAQ;;EAER;EACA;;;;;;EAMA;EACA,QAAQ;IAAU,SAAS,MAAM;IAAW,WAAW,MAAM;;EAC7D,YAAY;;cAGR,UAAS,WAAA,OAAA,QAAA,UAAA,WAAA,OAAA,UAAA,gBAAA,SAAA,UAAA,IAAA,KAAA,MAAA,UAAA,cAAA,SAaZ,0BAAK,IAAA"}
|
|
@@ -4,9 +4,9 @@ import { field_exports } from "../../../core/field.mjs";
|
|
|
4
4
|
import { radio_group_exports } from "../../../core/radio-group.mjs";
|
|
5
5
|
import { RadioGroupContext } from "./context.mjs";
|
|
6
6
|
import { useContext, useId, useRef } from "react";
|
|
7
|
-
import { Circle, CircleCheck } from "lucide-react";
|
|
8
7
|
import { useControllableState, useKeyPress } from "@jbpark/use-hooks";
|
|
9
8
|
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Circle, CircleCheck } from "lucide-react";
|
|
10
10
|
//#region src/components/atoms/radio/radio.tsx
|
|
11
11
|
const { RadioGroup: Core, RadioGroupItem: Item } = radio_group_exports;
|
|
12
12
|
const { Field, FieldLabel } = field_exports;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ToolbarItem, ToolbarPreset } from "./types.mjs";
|
|
2
2
|
//#region src/components/atoms/rich-text-editor/rich-text-editor.d.ts
|
|
3
|
-
interface Props {
|
|
3
|
+
export interface Props {
|
|
4
4
|
value?: string;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
className?: string;
|
|
@@ -16,9 +16,14 @@ interface Props {
|
|
|
16
16
|
toolbar?: boolean | ToolbarPreset[];
|
|
17
17
|
/** Extra buttons appended after the built-in presets. */
|
|
18
18
|
toolbarItems?: ToolbarItem[];
|
|
19
|
+
/** Called after each document edit with the current HTML. */
|
|
20
|
+
onUpdate?: (value: string) => void;
|
|
21
|
+
/** Called when the editor loses focus with the current HTML. */
|
|
22
|
+
onCommit?: (value: string) => void;
|
|
23
|
+
/** @deprecated Use `onCommit` for the existing blur-only behavior. */
|
|
19
24
|
onChange?: (value: string) => void;
|
|
20
25
|
}
|
|
21
|
-
declare const RichTextEditor: ({ value, placeholder, className, classNames, toolbar, toolbarItems, onChange }: Props) => import("react").JSX.Element;
|
|
26
|
+
declare const RichTextEditor: ({ value, placeholder, className, classNames, toolbar, toolbarItems, onUpdate, onCommit, onChange }: Props) => import("react").JSX.Element;
|
|
22
27
|
//#endregion
|
|
23
|
-
export {
|
|
28
|
+
export { RichTextEditor as default };
|
|
24
29
|
//# sourceMappingURL=rich-text-editor.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.d.mts","names":[],"sources":["../../../../src/components/atoms/rich-text-editor/rich-text-editor.tsx"],"mappings":";;
|
|
1
|
+
{"version":3,"file":"rich-text-editor.d.mts","names":[],"sources":["../../../../src/components/atoms/rich-text-editor/rich-text-editor.tsx"],"mappings":";;iBAgBiB;EACf;EACA;EACA;EACA;IACE;IACA;;;;;;;EAOF,oBAAoB;;EAEpB,eAAe;;EAEf,YAAY;;EAEZ,YAAY;;EAEZ,YAAY;;cAGR,mBAAkB,OAAA,aAAA,WAAA,YAAA,SAAA,cAAA,UAAA,UAAA,YAUrB,0BAAK,IAAA"}
|
|
@@ -10,7 +10,7 @@ import { TextStyleKit } from "@tiptap/extension-text-style";
|
|
|
10
10
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
11
11
|
import StarterKit from "@tiptap/starter-kit";
|
|
12
12
|
//#region src/components/atoms/rich-text-editor/rich-text-editor.tsx
|
|
13
|
-
const RichTextEditor = ({ value = "", placeholder = "Enter text...", className, classNames, toolbar = false, toolbarItems, onChange }) => {
|
|
13
|
+
const RichTextEditor = ({ value = "", placeholder = "Enter text...", className, classNames, toolbar = false, toolbarItems, onUpdate, onCommit, onChange }) => {
|
|
14
14
|
const presets = toolbar === true ? DEFAULT_TOOLBAR_PRESETS : toolbar || [];
|
|
15
15
|
const showToolbar = presets.length > 0 || (toolbarItems?.length ?? 0) > 0;
|
|
16
16
|
const editor = useEditor({
|
|
@@ -25,8 +25,13 @@ const RichTextEditor = ({ value = "", placeholder = "Enter text...", className,
|
|
|
25
25
|
})
|
|
26
26
|
],
|
|
27
27
|
content: value,
|
|
28
|
+
onUpdate: ({ editor: e }) => {
|
|
29
|
+
onUpdate?.(e.getHTML());
|
|
30
|
+
},
|
|
28
31
|
onBlur: ({ editor: e }) => {
|
|
29
|
-
|
|
32
|
+
const html = e.getHTML();
|
|
33
|
+
onCommit?.(html);
|
|
34
|
+
onChange?.(html);
|
|
30
35
|
},
|
|
31
36
|
shouldRerenderOnTransaction: showToolbar
|
|
32
37
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rich-text-editor.mjs","names":[],"sources":["../../../../src/components/atoms/rich-text-editor/rich-text-editor.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { TextStyleKit } from '@tiptap/extension-text-style';\nimport { EditorContent, useEditor } from '@tiptap/react';\nimport StarterKit from '@tiptap/starter-kit';\n\nimport { cn } from '@repo/ui/utils';\n\nimport { RICH_TEXT_CONTENT_CLASSES } from './content-classes';\nimport Toolbar from './toolbar';\nimport { DEFAULT_TOOLBAR_PRESETS } from './toolbar-presets';\nimport type { ToolbarItem, ToolbarPreset } from './types';\n\nexport interface Props {\n value?: string;\n placeholder?: string;\n className?: string;\n classNames?: {\n toolbar?: string;\n content?: string;\n };\n /**\n * `true` shows every built-in preset; an array shows only the listed\n * presets, in the given order. Omitted or `false` renders no toolbar,\n * matching the original (toolbar-less) output.\n */\n toolbar?: boolean | ToolbarPreset[];\n /** Extra buttons appended after the built-in presets. */\n toolbarItems?: ToolbarItem[];\n onChange?: (value: string) => void;\n}\n\nconst RichTextEditor = ({\n value = '',\n placeholder = 'Enter text...',\n className,\n classNames,\n toolbar = false,\n toolbarItems,\n onChange,\n}: Props) => {\n const presets = toolbar === true ? DEFAULT_TOOLBAR_PRESETS : toolbar || [];\n const showToolbar = presets.length > 0 || (toolbarItems?.length ?? 0) > 0;\n\n const editor = useEditor({\n // SSR renders every exported component without effects running, so the\n // editor must not touch the DOM during that first pass — deferring\n // creation to mount keeps `renderToStaticMarkup` from throwing.\n immediatelyRender: false,\n extensions: [\n StarterKit,\n Placeholder.configure({ placeholder }),\n TextStyleKit.configure({\n fontFamily: false,\n lineHeight: false,\n backgroundColor: false,\n }),\n ],\n content: value,\n
|
|
1
|
+
{"version":3,"file":"rich-text-editor.mjs","names":[],"sources":["../../../../src/components/atoms/rich-text-editor/rich-text-editor.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect } from 'react';\n\nimport Placeholder from '@tiptap/extension-placeholder';\nimport { TextStyleKit } from '@tiptap/extension-text-style';\nimport { EditorContent, useEditor } from '@tiptap/react';\nimport StarterKit from '@tiptap/starter-kit';\n\nimport { cn } from '@repo/ui/utils';\n\nimport { RICH_TEXT_CONTENT_CLASSES } from './content-classes';\nimport Toolbar from './toolbar';\nimport { DEFAULT_TOOLBAR_PRESETS } from './toolbar-presets';\nimport type { ToolbarItem, ToolbarPreset } from './types';\n\nexport interface Props {\n value?: string;\n placeholder?: string;\n className?: string;\n classNames?: {\n toolbar?: string;\n content?: string;\n };\n /**\n * `true` shows every built-in preset; an array shows only the listed\n * presets, in the given order. Omitted or `false` renders no toolbar,\n * matching the original (toolbar-less) output.\n */\n toolbar?: boolean | ToolbarPreset[];\n /** Extra buttons appended after the built-in presets. */\n toolbarItems?: ToolbarItem[];\n /** Called after each document edit with the current HTML. */\n onUpdate?: (value: string) => void;\n /** Called when the editor loses focus with the current HTML. */\n onCommit?: (value: string) => void;\n /** @deprecated Use `onCommit` for the existing blur-only behavior. */\n onChange?: (value: string) => void;\n}\n\nconst RichTextEditor = ({\n value = '',\n placeholder = 'Enter text...',\n className,\n classNames,\n toolbar = false,\n toolbarItems,\n onUpdate,\n onCommit,\n onChange,\n}: Props) => {\n const presets = toolbar === true ? DEFAULT_TOOLBAR_PRESETS : toolbar || [];\n const showToolbar = presets.length > 0 || (toolbarItems?.length ?? 0) > 0;\n\n const editor = useEditor({\n // SSR renders every exported component without effects running, so the\n // editor must not touch the DOM during that first pass — deferring\n // creation to mount keeps `renderToStaticMarkup` from throwing.\n immediatelyRender: false,\n extensions: [\n StarterKit,\n Placeholder.configure({ placeholder }),\n TextStyleKit.configure({\n fontFamily: false,\n lineHeight: false,\n backgroundColor: false,\n }),\n ],\n content: value,\n onUpdate: ({ editor: e }) => {\n onUpdate?.(e.getHTML());\n },\n onBlur: ({ editor: e }) => {\n const html = e.getHTML();\n\n onCommit?.(html);\n onChange?.(html);\n },\n // @tiptap/react v3 only re-renders on selection/transaction changes when\n // explicitly opted in — the toolbar's isActive()/getAttributes() reads\n // need that to reflect the caret position live.\n shouldRerenderOnTransaction: showToolbar,\n });\n\n useEffect(() => {\n if (!editor) {\n return;\n }\n\n const current = editor.getHTML();\n\n if (current !== value) {\n editor.commands.setContent(value, { emitUpdate: false });\n }\n }, [value, editor]);\n\n return (\n <div\n data-slot=\"rich-text-editor\"\n className={cn(\n 'border-input bg-background text-foreground rounded border text-sm',\n className,\n //\n )}\n >\n {showToolbar && editor && (\n <Toolbar\n editor={editor}\n presets={presets}\n items={toolbarItems}\n className={classNames?.toolbar}\n />\n )}\n <div\n data-slot=\"rich-text-editor-content\"\n className={cn(\n 'min-h-20 px-3 py-2',\n RICH_TEXT_CONTENT_CLASSES,\n classNames?.content,\n //\n )}\n >\n <EditorContent editor={editor} />\n </div>\n </div>\n );\n};\n\nexport default RichTextEditor;\n"],"mappings":";;;;;;;;;;;;AAwCA,MAAM,kBAAkB,EACtB,QAAQ,IACR,cAAc,iBACd,WACA,YACA,UAAU,OACV,cACA,UACA,UACA,eACW;CACX,MAAM,UAAU,YAAY,OAAO,0BAA0B,WAAW,CAAC;CACzE,MAAM,cAAc,QAAQ,SAAS,MAAM,cAAc,UAAU,KAAK;CAExE,MAAM,SAAS,UAAU;EAIvB,mBAAmB;EACnB,YAAY;GACV;GACA,YAAY,UAAU,EAAE,YAAY,CAAC;GACrC,aAAa,UAAU;IACrB,YAAY;IACZ,YAAY;IACZ,iBAAiB;GACnB,CAAC;EACH;EACA,SAAS;EACT,WAAW,EAAE,QAAQ,QAAQ;GAC3B,WAAW,EAAE,QAAQ,CAAC;EACxB;EACA,SAAS,EAAE,QAAQ,QAAQ;GACzB,MAAM,OAAO,EAAE,QAAQ;GAEvB,WAAW,IAAI;GACf,WAAW,IAAI;EACjB;EAIA,6BAA6B;CAC/B,CAAC;CAED,gBAAgB;EACd,IAAI,CAAC,QACH;EAKF,IAFgB,OAAO,QAEb,MAAM,OACd,OAAO,SAAS,WAAW,OAAO,EAAE,YAAY,MAAM,CAAC;CAE3D,GAAG,CAAC,OAAO,MAAM,CAAC;CAElB,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,qEACA,SAEF;EANF,UAAA,CAQG,eAAe,UACd,oBAAC,SAAD;GACU;GACC;GACT,OAAO;GACP,WAAW,YAAY;EACxB,CAAA,GAEH,oBAAC,OAAD;GACE,aAAU;GACV,WAAW,GACT,sBACA,2BACA,YAAY,OAEd;GAEA,UAAA,oBAAC,eAAD,EAAuB,OAAS,CAAA;EAC7B,CAAA,CACF;;AAET"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import Button from "../../../Button.mjs";
|
|
3
|
+
import Input from "../input/index.mjs";
|
|
3
4
|
import Popover from "../popover.mjs";
|
|
4
5
|
import ColorPicker from "../color-picker.mjs";
|
|
5
|
-
import Input from "../input/index.mjs";
|
|
6
6
|
import ToolbarButton from "./toolbar-button.mjs";
|
|
7
7
|
import Select from "../select.mjs";
|
|
8
8
|
import { useState } from "react";
|
|
9
|
-
import { Bold, Code, Code2, Italic, Link, List, ListOrdered, Minus, Quote, Redo2, Strikethrough, Underline, Undo2 } from "lucide-react";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Bold, Code, Code2, Italic, Link, List, ListOrdered, Minus, Quote, Redo2, Strikethrough, Underline, Undo2 } from "lucide-react";
|
|
11
11
|
//#region src/components/atoms/rich-text-editor/toolbar-presets.tsx
|
|
12
12
|
const FONT_SIZE_OPTIONS = [
|
|
13
13
|
{
|