@codefast/ui 0.0.65 → 0.0.67
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/{chunk-ZMF2SRE5.js → chunk-26W5NJTU.js} +1 -1
- package/dist/chunk-26W5NJTU.js.map +1 -0
- package/dist/chunk-3COHZ24E.cjs +2 -0
- package/dist/chunk-3COHZ24E.cjs.map +1 -0
- package/dist/{chunk-QEWITXOV.cjs → chunk-4MTN7WZ2.cjs} +1 -1
- package/dist/chunk-4MTN7WZ2.cjs.map +1 -0
- package/dist/chunk-5QETIFO4.js +2 -0
- package/dist/chunk-5QETIFO4.js.map +1 -0
- package/dist/{chunk-WECV77JD.cjs → chunk-5RJANBDJ.cjs} +1 -1
- package/dist/chunk-5RJANBDJ.cjs.map +1 -0
- package/dist/chunk-6UQKMUZG.cjs +2 -0
- package/dist/chunk-6UQKMUZG.cjs.map +1 -0
- package/dist/chunk-AVEDWLNQ.js +2 -0
- package/dist/chunk-AVEDWLNQ.js.map +1 -0
- package/dist/{chunk-YLE5XFEO.cjs → chunk-EW7DAPDC.cjs} +1 -1
- package/dist/chunk-EW7DAPDC.cjs.map +1 -0
- package/dist/{chunk-RSNKUKY7.js → chunk-HDHZESSG.js} +1 -1
- package/dist/chunk-HDHZESSG.js.map +1 -0
- package/dist/{chunk-GCHNSK5O.cjs → chunk-JMM2MTPI.cjs} +1 -1
- package/dist/chunk-JMM2MTPI.cjs.map +1 -0
- package/dist/{chunk-WRO3QIWH.js → chunk-JNOLIDCD.js} +1 -1
- package/dist/chunk-JNOLIDCD.js.map +1 -0
- package/dist/{chunk-F5TIIJJJ.cjs → chunk-LOJBMYTH.cjs} +1 -1
- package/dist/chunk-LOJBMYTH.cjs.map +1 -0
- package/dist/{chunk-A5ILA637.js → chunk-RBP4PBCK.js} +1 -1
- package/dist/chunk-RBP4PBCK.js.map +1 -0
- package/dist/{chunk-L7IASKCH.js → chunk-RVGKUNXC.js} +1 -1
- package/dist/{chunk-L7IASKCH.js.map → chunk-RVGKUNXC.js.map} +1 -1
- package/dist/{chunk-72NPDP3X.cjs → chunk-T3G5USVY.cjs} +1 -1
- package/dist/chunk-T3G5USVY.cjs.map +1 -0
- package/dist/chunk-VDVLCSO4.js +2 -0
- package/dist/chunk-VDVLCSO4.js.map +1 -0
- package/dist/{chunk-2OBTJ7SD.cjs → chunk-WKKCZQNO.cjs} +2 -2
- package/dist/chunk-WKKCZQNO.cjs.map +1 -0
- package/dist/{chunk-FNQFZJUG.js → chunk-WQFHFTYS.js} +1 -1
- package/dist/chunk-WQFHFTYS.js.map +1 -0
- package/dist/react/accordion.cjs.map +1 -1
- package/dist/react/accordion.js.map +1 -1
- package/dist/react/alert-dialog.cjs +1 -1
- package/dist/react/alert-dialog.cjs.map +1 -1
- package/dist/react/alert-dialog.js +1 -1
- package/dist/react/alert-dialog.js.map +1 -1
- package/dist/react/alert.cjs.map +1 -1
- package/dist/react/alert.js.map +1 -1
- package/dist/react/avatar.cjs.map +1 -1
- package/dist/react/avatar.js.map +1 -1
- package/dist/react/blockquote.cjs.map +1 -1
- package/dist/react/blockquote.js.map +1 -1
- package/dist/react/box.cjs.map +1 -1
- package/dist/react/box.js.map +1 -1
- package/dist/react/breadcrumb.cjs.map +1 -1
- package/dist/react/breadcrumb.js.map +1 -1
- package/dist/react/button.cjs +1 -1
- package/dist/react/button.js +1 -1
- package/dist/react/calendar.cjs +1 -1
- package/dist/react/calendar.js +1 -1
- package/dist/react/card.cjs.map +1 -1
- package/dist/react/card.js.map +1 -1
- package/dist/react/carousel.cjs +1 -1
- package/dist/react/carousel.cjs.map +1 -1
- package/dist/react/carousel.js +1 -1
- package/dist/react/carousel.js.map +1 -1
- package/dist/react/checkbox-cards.cjs +1 -1
- package/dist/react/checkbox-cards.cjs.map +1 -1
- package/dist/react/checkbox-cards.js +1 -1
- package/dist/react/checkbox-cards.js.map +1 -1
- package/dist/react/checkbox-group.cjs +1 -1
- package/dist/react/checkbox-group.cjs.map +1 -1
- package/dist/react/checkbox-group.js +1 -1
- package/dist/react/checkbox-group.js.map +1 -1
- package/dist/react/checkbox-group.primitive.cjs +1 -1
- package/dist/react/checkbox-group.primitive.js +1 -1
- package/dist/react/checkbox.cjs +1 -1
- package/dist/react/checkbox.cjs.map +1 -1
- package/dist/react/checkbox.js +1 -1
- package/dist/react/checkbox.js.map +1 -1
- package/dist/react/code.cjs.map +1 -1
- package/dist/react/code.js.map +1 -1
- package/dist/react/collapsible.cjs.map +1 -1
- package/dist/react/collapsible.js.map +1 -1
- package/dist/react/command.cjs +1 -1
- package/dist/react/command.cjs.map +1 -1
- package/dist/react/command.js +1 -1
- package/dist/react/command.js.map +1 -1
- package/dist/react/container.cjs.map +1 -1
- package/dist/react/container.js.map +1 -1
- package/dist/react/context-menu.cjs.map +1 -1
- package/dist/react/context-menu.js.map +1 -1
- package/dist/react/data-table.cjs +1 -1
- package/dist/react/data-table.js +1 -1
- package/dist/react/dialog.cjs +1 -1
- package/dist/react/dialog.js +1 -1
- package/dist/react/drawer.cjs.map +1 -1
- package/dist/react/drawer.js.map +1 -1
- package/dist/react/dropdown-menu.cjs +1 -1
- package/dist/react/dropdown-menu.js +1 -1
- package/dist/react/em.cjs.map +1 -1
- package/dist/react/em.js.map +1 -1
- package/dist/react/form.cjs +1 -1
- package/dist/react/form.cjs.map +1 -1
- package/dist/react/form.js +1 -1
- package/dist/react/form.js.map +1 -1
- package/dist/react/heading.cjs.map +1 -1
- package/dist/react/heading.js.map +1 -1
- package/dist/react/hover-card.cjs.map +1 -1
- package/dist/react/hover-card.js.map +1 -1
- package/dist/react/input-otp.cjs +1 -1
- package/dist/react/input-otp.cjs.map +1 -1
- package/dist/react/input-otp.js +1 -1
- package/dist/react/input-otp.js.map +1 -1
- package/dist/react/input.cjs +1 -1
- package/dist/react/input.cjs.map +1 -1
- package/dist/react/input.d.cts +113 -34
- package/dist/react/input.d.ts +113 -34
- package/dist/react/input.js +1 -1
- package/dist/react/input.js.map +1 -1
- package/dist/react/kbd.cjs.map +1 -1
- package/dist/react/kbd.js.map +1 -1
- package/dist/react/label.cjs +1 -1
- package/dist/react/label.js +1 -1
- package/dist/react/menubar.cjs.map +1 -1
- package/dist/react/menubar.js.map +1 -1
- package/dist/react/navigation-menu.cjs.map +1 -1
- package/dist/react/navigation-menu.js.map +1 -1
- package/dist/react/pagination.cjs +1 -1
- package/dist/react/pagination.cjs.map +1 -1
- package/dist/react/pagination.js +1 -1
- package/dist/react/pagination.js.map +1 -1
- package/dist/react/popover.cjs.map +1 -1
- package/dist/react/popover.js.map +1 -1
- package/dist/react/pre.cjs.map +1 -1
- package/dist/react/pre.js.map +1 -1
- package/dist/react/progress.cjs.map +1 -1
- package/dist/react/progress.js.map +1 -1
- package/dist/react/quote.cjs.map +1 -1
- package/dist/react/quote.js.map +1 -1
- package/dist/react/radio-cards.cjs +1 -1
- package/dist/react/radio-cards.cjs.map +1 -1
- package/dist/react/radio-cards.js +1 -1
- package/dist/react/radio-cards.js.map +1 -1
- package/dist/react/radio-group.cjs.map +1 -1
- package/dist/react/radio-group.js.map +1 -1
- package/dist/react/radio.cjs.map +1 -1
- package/dist/react/radio.js.map +1 -1
- package/dist/react/scroll-area.cjs.map +1 -1
- package/dist/react/scroll-area.js.map +1 -1
- package/dist/react/section.cjs.map +1 -1
- package/dist/react/section.js.map +1 -1
- package/dist/react/select.cjs +1 -1
- package/dist/react/select.js +1 -1
- package/dist/react/separator.cjs.map +1 -1
- package/dist/react/separator.js.map +1 -1
- package/dist/react/sheet.cjs.map +1 -1
- package/dist/react/sheet.js.map +1 -1
- package/dist/react/slider.cjs.map +1 -1
- package/dist/react/slider.js.map +1 -1
- package/dist/react/spinner.cjs +1 -1
- package/dist/react/spinner.js +1 -1
- package/dist/react/strong.cjs.map +1 -1
- package/dist/react/strong.js.map +1 -1
- package/dist/react/switch.cjs +1 -1
- package/dist/react/switch.cjs.map +1 -1
- package/dist/react/switch.js +1 -1
- package/dist/react/switch.js.map +1 -1
- package/dist/react/table.cjs.map +1 -1
- package/dist/react/table.js.map +1 -1
- package/dist/react/tabs.cjs.map +1 -1
- package/dist/react/tabs.js.map +1 -1
- package/dist/react/text-input.cjs +2 -0
- package/dist/react/text-input.cjs.map +1 -0
- package/dist/react/text-input.d.cts +11 -0
- package/dist/react/text-input.d.ts +11 -0
- package/dist/react/text-input.js +2 -0
- package/dist/react/text-input.js.map +1 -0
- package/dist/react/text.cjs.map +1 -1
- package/dist/react/text.js.map +1 -1
- package/dist/react/textarea.cjs +1 -1
- package/dist/react/textarea.cjs.map +1 -1
- package/dist/react/textarea.js +1 -1
- package/dist/react/textarea.js.map +1 -1
- package/dist/react/toggle-group.cjs +1 -1
- package/dist/react/toggle-group.cjs.map +1 -1
- package/dist/react/toggle-group.js +1 -1
- package/dist/react/toggle-group.js.map +1 -1
- package/dist/react/toggle.cjs +1 -1
- package/dist/react/toggle.js +1 -1
- package/dist/react/tooltip.cjs.map +1 -1
- package/dist/react/tooltip.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +76 -102
- package/dist/chunk-2OBTJ7SD.cjs.map +0 -1
- package/dist/chunk-3OEPCFBF.cjs +0 -2
- package/dist/chunk-3OEPCFBF.cjs.map +0 -1
- package/dist/chunk-6AFJCDFU.js +0 -2
- package/dist/chunk-6AFJCDFU.js.map +0 -1
- package/dist/chunk-72NPDP3X.cjs.map +0 -1
- package/dist/chunk-7CHCTEST.js +0 -2
- package/dist/chunk-7CHCTEST.js.map +0 -1
- package/dist/chunk-A5ILA637.js.map +0 -1
- package/dist/chunk-DH3YP4ZC.cjs +0 -2
- package/dist/chunk-DH3YP4ZC.cjs.map +0 -1
- package/dist/chunk-DTSAQICV.js +0 -2
- package/dist/chunk-DTSAQICV.js.map +0 -1
- package/dist/chunk-F5TIIJJJ.cjs.map +0 -1
- package/dist/chunk-FNQFZJUG.js.map +0 -1
- package/dist/chunk-GCHNSK5O.cjs.map +0 -1
- package/dist/chunk-NH6X3FON.js +0 -2
- package/dist/chunk-NH6X3FON.js.map +0 -1
- package/dist/chunk-P563ILDJ.cjs +0 -2
- package/dist/chunk-P563ILDJ.cjs.map +0 -1
- package/dist/chunk-QEWITXOV.cjs.map +0 -1
- package/dist/chunk-RSNKUKY7.js.map +0 -1
- package/dist/chunk-VVA2EE5V.js +0 -2
- package/dist/chunk-VVA2EE5V.js.map +0 -1
- package/dist/chunk-VZ6P3BCB.cjs +0 -2
- package/dist/chunk-VZ6P3BCB.cjs.map +0 -1
- package/dist/chunk-WECV77JD.cjs.map +0 -1
- package/dist/chunk-WRO3QIWH.js.map +0 -1
- package/dist/chunk-YLE5XFEO.cjs.map +0 -1
- package/dist/chunk-ZMF2SRE5.js.map +0 -1
- package/dist/hooks/use-media-query.cjs +0 -2
- package/dist/hooks/use-media-query.cjs.map +0 -1
- package/dist/hooks/use-media-query.d.cts +0 -3
- package/dist/hooks/use-media-query.d.ts +0 -3
- package/dist/hooks/use-media-query.js +0 -2
- package/dist/hooks/use-media-query.js.map +0 -1
- package/dist/hooks/use-mutation-observer.cjs +0 -2
- package/dist/hooks/use-mutation-observer.cjs.map +0 -1
- package/dist/hooks/use-mutation-observer.d.cts +0 -5
- package/dist/hooks/use-mutation-observer.d.ts +0 -5
- package/dist/hooks/use-mutation-observer.js +0 -2
- package/dist/hooks/use-mutation-observer.js.map +0 -1
- package/dist/lib/colors.cjs +0 -2
- package/dist/lib/colors.cjs.map +0 -1
- package/dist/lib/colors.d.cts +0 -1759
- package/dist/lib/colors.d.ts +0 -1759
- package/dist/lib/colors.js +0 -2
- package/dist/lib/colors.js.map +0 -1
- package/dist/plugin/animate.plugin.cjs +0 -2
- package/dist/plugin/animate.plugin.cjs.map +0 -1
- package/dist/plugin/animate.plugin.js +0 -2
- package/dist/plugin/animate.plugin.js.map +0 -1
- package/dist/plugin/base.plugin.cjs +0 -2
- package/dist/plugin/base.plugin.cjs.map +0 -1
- package/dist/plugin/base.plugin.js +0 -2
- package/dist/plugin/base.plugin.js.map +0 -1
- package/dist/plugin/perspective.plugin.cjs +0 -2
- package/dist/plugin/perspective.plugin.cjs.map +0 -1
- package/dist/plugin/perspective.plugin.js +0 -2
- package/dist/plugin/perspective.plugin.js.map +0 -1
- package/dist/tailwind.config.cjs +0 -2
- package/dist/tailwind.config.cjs.map +0 -1
- package/dist/tailwind.config.js +0 -2
- package/dist/tailwind.config.js.map +0 -1
- package/plugin/animate.plugin.ts +0 -319
- package/plugin/base.plugin.ts +0 -21
- package/plugin/perspective.plugin.ts +0 -11
- package/src/hooks/use-media-query.ts +0 -22
- package/src/hooks/use-mutation-observer.ts +0 -26
- package/src/lib/colors.ts +0 -1757
- package/src/lib/utils.ts +0 -6
- package/src/react/accordion.tsx +0 -86
- package/src/react/alert-dialog.tsx +0 -177
- package/src/react/alert.tsx +0 -71
- package/src/react/aspect-ratio.tsx +0 -17
- package/src/react/avatar.tsx +0 -58
- package/src/react/badge.tsx +0 -39
- package/src/react/blockquote.tsx +0 -26
- package/src/react/box.tsx +0 -34
- package/src/react/breadcrumb.tsx +0 -148
- package/src/react/button.tsx +0 -95
- package/src/react/calendar.tsx +0 -79
- package/src/react/card.tsx +0 -103
- package/src/react/carousel.tsx +0 -299
- package/src/react/checkbox-cards.tsx +0 -59
- package/src/react/checkbox-group.primitive.tsx +0 -200
- package/src/react/checkbox-group.tsx +0 -53
- package/src/react/checkbox.tsx +0 -36
- package/src/react/code.tsx +0 -26
- package/src/react/collapsible.tsx +0 -54
- package/src/react/command.tsx +0 -199
- package/src/react/container.tsx +0 -27
- package/src/react/context-menu.tsx +0 -302
- package/src/react/data-table.tsx +0 -249
- package/src/react/dialog.tsx +0 -156
- package/src/react/drawer.tsx +0 -132
- package/src/react/dropdown-menu.tsx +0 -286
- package/src/react/em.tsx +0 -26
- package/src/react/form.tsx +0 -218
- package/src/react/heading.tsx +0 -27
- package/src/react/hover-card.tsx +0 -73
- package/src/react/input-otp.tsx +0 -114
- package/src/react/input.tsx +0 -42
- package/src/react/kbd.tsx +0 -36
- package/src/react/label.tsx +0 -31
- package/src/react/menubar.tsx +0 -316
- package/src/react/navigation-menu.tsx +0 -192
- package/src/react/pagination.tsx +0 -150
- package/src/react/popover.tsx +0 -82
- package/src/react/pre.tsx +0 -26
- package/src/react/progress.tsx +0 -35
- package/src/react/quote.tsx +0 -26
- package/src/react/radio-cards.tsx +0 -46
- package/src/react/radio-group.tsx +0 -48
- package/src/react/radio.tsx +0 -38
- package/src/react/resizable.tsx +0 -62
- package/src/react/scroll-area.tsx +0 -106
- package/src/react/section.tsx +0 -26
- package/src/react/select.tsx +0 -217
- package/src/react/separator.tsx +0 -32
- package/src/react/sheet.tsx +0 -170
- package/src/react/skeleton.tsx +0 -18
- package/src/react/slider.tsx +0 -41
- package/src/react/sonner.tsx +0 -40
- package/src/react/spinner.tsx +0 -68
- package/src/react/strong.tsx +0 -26
- package/src/react/switch.tsx +0 -33
- package/src/react/table.tsx +0 -142
- package/src/react/tabs.tsx +0 -87
- package/src/react/text.tsx +0 -34
- package/src/react/textarea.tsx +0 -30
- package/src/react/toggle-group.tsx +0 -81
- package/src/react/toggle.tsx +0 -49
- package/src/react/tooltip.tsx +0 -81
- package/src/styles/styles.css +0 -3
- package/tailwind.config.ts +0 -126
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
-
import { createCheckboxScope } from '@radix-ui/react-checkbox';
|
|
4
|
-
import { createContextScope, type Scope } from '@radix-ui/react-context';
|
|
5
|
-
import * as RovingFocusGroup from '@radix-ui/react-roving-focus';
|
|
6
|
-
import { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';
|
|
7
|
-
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
8
|
-
import { useDirection } from '@radix-ui/react-direction';
|
|
9
|
-
import { Primitive } from '@radix-ui/react-primitive';
|
|
10
|
-
|
|
11
|
-
/* -------------------------------------------------------------------------------------------------
|
|
12
|
-
* Component: CheckboxGroup
|
|
13
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
14
|
-
|
|
15
|
-
const CHECKBOX_GROUP_NAME = 'CheckboxGroup';
|
|
16
|
-
|
|
17
|
-
type ScopedProps<P> = P & { __scopeCheckboxGroup?: Scope };
|
|
18
|
-
|
|
19
|
-
const [createCheckboxGroupContext, createCheckboxGroupScope] = createContextScope(CHECKBOX_GROUP_NAME, [
|
|
20
|
-
createRovingFocusGroupScope,
|
|
21
|
-
createCheckboxScope,
|
|
22
|
-
]);
|
|
23
|
-
|
|
24
|
-
const useRovingFocusGroupScope = createRovingFocusGroupScope();
|
|
25
|
-
const useCheckboxScope = createCheckboxScope();
|
|
26
|
-
|
|
27
|
-
interface CheckboxGroupContextValue {
|
|
28
|
-
disabled: boolean;
|
|
29
|
-
onItemCheck: (value: string) => void;
|
|
30
|
-
onItemUncheck: (value: string) => void;
|
|
31
|
-
required: boolean;
|
|
32
|
-
name?: string;
|
|
33
|
-
value?: string[];
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const [CheckboxGroupProvider, useCheckboxGroupContext] =
|
|
37
|
-
createCheckboxGroupContext<CheckboxGroupContextValue>(CHECKBOX_GROUP_NAME);
|
|
38
|
-
|
|
39
|
-
type CheckboxGroupElement = React.ElementRef<typeof Primitive.div>;
|
|
40
|
-
|
|
41
|
-
interface CheckboxGroupProps extends React.ComponentPropsWithoutRef<typeof Primitive.div> {
|
|
42
|
-
defaultValue?: string[];
|
|
43
|
-
dir?: RovingFocusGroup.RovingFocusGroupProps['dir'];
|
|
44
|
-
disabled?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['disabled'];
|
|
45
|
-
loop?: RovingFocusGroup.RovingFocusGroupProps['loop'];
|
|
46
|
-
name?: CheckboxGroupContextValue['name'];
|
|
47
|
-
onValueChange?: (value: string[]) => void;
|
|
48
|
-
orientation?: RovingFocusGroup.RovingFocusGroupProps['orientation'];
|
|
49
|
-
required?: React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>['required'];
|
|
50
|
-
value?: CheckboxGroupContextValue['value'];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
const CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(
|
|
54
|
-
(
|
|
55
|
-
{
|
|
56
|
-
__scopeCheckboxGroup,
|
|
57
|
-
name,
|
|
58
|
-
defaultValue,
|
|
59
|
-
value: valueProp,
|
|
60
|
-
required = false,
|
|
61
|
-
disabled = false,
|
|
62
|
-
orientation,
|
|
63
|
-
dir,
|
|
64
|
-
loop = true,
|
|
65
|
-
onValueChange,
|
|
66
|
-
...props
|
|
67
|
-
}: ScopedProps<CheckboxGroupProps>,
|
|
68
|
-
ref,
|
|
69
|
-
) => {
|
|
70
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);
|
|
71
|
-
const direction = useDirection(dir);
|
|
72
|
-
const [value = [], setValue] = useControllableState({
|
|
73
|
-
prop: valueProp,
|
|
74
|
-
defaultProp: defaultValue,
|
|
75
|
-
onChange: onValueChange,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const handleItemCheck = React.useCallback(
|
|
79
|
-
(itemValue: string) => {
|
|
80
|
-
setValue((prevValue = []) => [...prevValue, itemValue]);
|
|
81
|
-
},
|
|
82
|
-
[setValue],
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
const handleItemUncheck = React.useCallback(
|
|
86
|
-
(itemValue: string) => {
|
|
87
|
-
setValue((prevValue = []) => prevValue.filter((val) => val !== itemValue));
|
|
88
|
-
},
|
|
89
|
-
[setValue],
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
return (
|
|
93
|
-
<CheckboxGroupProvider
|
|
94
|
-
disabled={disabled}
|
|
95
|
-
name={name}
|
|
96
|
-
required={required}
|
|
97
|
-
scope={__scopeCheckboxGroup}
|
|
98
|
-
value={value}
|
|
99
|
-
onItemCheck={handleItemCheck}
|
|
100
|
-
onItemUncheck={handleItemUncheck}
|
|
101
|
-
>
|
|
102
|
-
<RovingFocusGroup.Root asChild {...rovingFocusGroupScope} dir={direction} loop={loop} orientation={orientation}>
|
|
103
|
-
{/* eslint-disable-next-line react/jsx-pascal-case -- radix-ui */}
|
|
104
|
-
<Primitive.div ref={ref} data-disabled={disabled ? '' : undefined} dir={direction} role="group" {...props} />
|
|
105
|
-
</RovingFocusGroup.Root>
|
|
106
|
-
</CheckboxGroupProvider>
|
|
107
|
-
);
|
|
108
|
-
},
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
CheckboxGroup.displayName = CHECKBOX_GROUP_NAME;
|
|
112
|
-
|
|
113
|
-
/* -------------------------------------------------------------------------------------------------
|
|
114
|
-
* Component: CheckboxGroupItem
|
|
115
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
116
|
-
|
|
117
|
-
const ITEM_NAME = `${CHECKBOX_GROUP_NAME}Item`;
|
|
118
|
-
|
|
119
|
-
type CheckboxGroupItemElement = React.ElementRef<typeof CheckboxPrimitive.Root>;
|
|
120
|
-
|
|
121
|
-
interface CheckboxGroupItemProps
|
|
122
|
-
extends Omit<
|
|
123
|
-
React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,
|
|
124
|
-
'checked' | 'defaultChecked' | 'onCheckedChange' | 'name'
|
|
125
|
-
> {
|
|
126
|
-
value: string;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
const CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(
|
|
130
|
-
({ __scopeCheckboxGroup, disabled, ...props }: ScopedProps<CheckboxGroupItemProps>, ref) => {
|
|
131
|
-
const context = useCheckboxGroupContext(ITEM_NAME, __scopeCheckboxGroup);
|
|
132
|
-
const isDisabled = context.disabled || disabled;
|
|
133
|
-
const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeCheckboxGroup);
|
|
134
|
-
const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);
|
|
135
|
-
const checked = context.value?.includes(props.value);
|
|
136
|
-
|
|
137
|
-
return (
|
|
138
|
-
<RovingFocusGroup.Item asChild {...rovingFocusGroupScope} active={checked} focusable={!isDisabled}>
|
|
139
|
-
<CheckboxPrimitive.Root
|
|
140
|
-
ref={ref}
|
|
141
|
-
checked={checked}
|
|
142
|
-
disabled={isDisabled}
|
|
143
|
-
name={context.name}
|
|
144
|
-
required={context.required}
|
|
145
|
-
{...checkboxScope}
|
|
146
|
-
{...props}
|
|
147
|
-
onCheckedChange={(checkedState) => {
|
|
148
|
-
if (checkedState) {
|
|
149
|
-
context.onItemCheck(props.value);
|
|
150
|
-
} else {
|
|
151
|
-
context.onItemUncheck(props.value);
|
|
152
|
-
}
|
|
153
|
-
}}
|
|
154
|
-
/>
|
|
155
|
-
</RovingFocusGroup.Item>
|
|
156
|
-
);
|
|
157
|
-
},
|
|
158
|
-
);
|
|
159
|
-
|
|
160
|
-
CheckboxGroupItem.displayName = ITEM_NAME;
|
|
161
|
-
|
|
162
|
-
/* -------------------------------------------------------------------------------------------------
|
|
163
|
-
* Component: CheckboxGroupIndicator
|
|
164
|
-
* -----------------------------------------------------------------------------------------------*/
|
|
165
|
-
|
|
166
|
-
const INDICATOR_NAME = `${CHECKBOX_GROUP_NAME}Indicator`;
|
|
167
|
-
|
|
168
|
-
type CheckboxGroupIndicatorElement = React.ElementRef<typeof CheckboxPrimitive.Indicator>;
|
|
169
|
-
type CheckboxGroupIndicatorProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Indicator>;
|
|
170
|
-
|
|
171
|
-
const CheckboxGroupIndicator = React.forwardRef<CheckboxGroupIndicatorElement, CheckboxGroupIndicatorProps>(
|
|
172
|
-
({ __scopeCheckboxGroup, ...props }: ScopedProps<CheckboxGroupIndicatorProps>, ref) => {
|
|
173
|
-
const checkboxScope = useCheckboxScope(__scopeCheckboxGroup);
|
|
174
|
-
|
|
175
|
-
return <CheckboxPrimitive.Indicator ref={ref} {...checkboxScope} {...props} />;
|
|
176
|
-
},
|
|
177
|
-
);
|
|
178
|
-
|
|
179
|
-
CheckboxGroupIndicator.displayName = INDICATOR_NAME;
|
|
180
|
-
|
|
181
|
-
/* -----------------------------------------------------------------------------
|
|
182
|
-
* Exports
|
|
183
|
-
* -------------------------------------------------------------------------- */
|
|
184
|
-
|
|
185
|
-
const Root = CheckboxGroup;
|
|
186
|
-
const Item = CheckboxGroupItem;
|
|
187
|
-
const Indicator = CheckboxGroupIndicator;
|
|
188
|
-
|
|
189
|
-
export {
|
|
190
|
-
createCheckboxGroupScope,
|
|
191
|
-
CheckboxGroup,
|
|
192
|
-
CheckboxGroupItem,
|
|
193
|
-
CheckboxGroupIndicator,
|
|
194
|
-
Root,
|
|
195
|
-
Item,
|
|
196
|
-
Indicator,
|
|
197
|
-
type CheckboxGroupProps,
|
|
198
|
-
type CheckboxGroupItemProps,
|
|
199
|
-
type CheckboxGroupIndicatorProps,
|
|
200
|
-
};
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { CheckIcon } from '@radix-ui/react-icons';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
import * as CheckboxGroupPrimitive from './checkbox-group.primitive';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: CheckboxGroup
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type CheckboxGroupElement = React.ElementRef<typeof CheckboxGroupPrimitive.Root>;
|
|
13
|
-
type CheckboxGroupProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Root>;
|
|
14
|
-
|
|
15
|
-
const CheckboxGroup = React.forwardRef<CheckboxGroupElement, CheckboxGroupProps>(({ className, ...props }, ref) => {
|
|
16
|
-
return <CheckboxGroupPrimitive.Root ref={ref} className={cn('grid gap-2', className)} {...props} />;
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
20
|
-
|
|
21
|
-
/* -----------------------------------------------------------------------------
|
|
22
|
-
* Component: CheckboxGroupItem
|
|
23
|
-
* -------------------------------------------------------------------------- */
|
|
24
|
-
|
|
25
|
-
type CheckboxGroupItemElement = React.ElementRef<typeof CheckboxGroupPrimitive.Item>;
|
|
26
|
-
type CheckboxGroupItemProps = React.ComponentPropsWithoutRef<typeof CheckboxGroupPrimitive.Item>;
|
|
27
|
-
|
|
28
|
-
const CheckboxGroupItem = React.forwardRef<CheckboxGroupItemElement, CheckboxGroupItemProps>(
|
|
29
|
-
({ className, ...props }, ref) => {
|
|
30
|
-
return (
|
|
31
|
-
<CheckboxGroupPrimitive.Item
|
|
32
|
-
ref={ref}
|
|
33
|
-
className={cn(
|
|
34
|
-
'border-input hover:border-primary aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none disabled:opacity-50',
|
|
35
|
-
className,
|
|
36
|
-
)}
|
|
37
|
-
{...props}
|
|
38
|
-
>
|
|
39
|
-
<CheckboxGroupPrimitive.CheckboxGroupIndicator className="flex size-full items-center justify-center text-current">
|
|
40
|
-
<CheckIcon className="size-3.5" />
|
|
41
|
-
</CheckboxGroupPrimitive.CheckboxGroupIndicator>
|
|
42
|
-
</CheckboxGroupPrimitive.Item>
|
|
43
|
-
);
|
|
44
|
-
},
|
|
45
|
-
);
|
|
46
|
-
|
|
47
|
-
CheckboxGroupItem.displayName = 'CheckboxGroupItem';
|
|
48
|
-
|
|
49
|
-
/* -----------------------------------------------------------------------------
|
|
50
|
-
* Exports
|
|
51
|
-
* -------------------------------------------------------------------------- */
|
|
52
|
-
|
|
53
|
-
export { CheckboxGroup, CheckboxGroupItem, type CheckboxGroupProps, type CheckboxGroupItemProps };
|
package/src/react/checkbox.tsx
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
5
|
-
import { CheckIcon } from '@radix-ui/react-icons';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
|
|
8
|
-
/* -----------------------------------------------------------------------------
|
|
9
|
-
* Component: Checkbox
|
|
10
|
-
* -------------------------------------------------------------------------- */
|
|
11
|
-
|
|
12
|
-
type CheckboxElement = React.ElementRef<typeof CheckboxPrimitive.Root>;
|
|
13
|
-
type CheckboxProps = React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>;
|
|
14
|
-
|
|
15
|
-
const Checkbox = React.forwardRef<CheckboxElement, CheckboxProps>(({ className, ...props }, ref) => (
|
|
16
|
-
<CheckboxPrimitive.Root
|
|
17
|
-
ref={ref}
|
|
18
|
-
className={cn(
|
|
19
|
-
'border-input hover:border-primary aria-checked:border-primary aria-checked:bg-primary aria-checked:text-primary-foreground peer flex size-4 shrink-0 rounded-sm border shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
20
|
-
className,
|
|
21
|
-
)}
|
|
22
|
-
{...props}
|
|
23
|
-
>
|
|
24
|
-
<CheckboxPrimitive.Indicator className="flex size-full items-center justify-center text-current">
|
|
25
|
-
<CheckIcon className="size-3.5" />
|
|
26
|
-
</CheckboxPrimitive.Indicator>
|
|
27
|
-
</CheckboxPrimitive.Root>
|
|
28
|
-
));
|
|
29
|
-
|
|
30
|
-
Checkbox.displayName = CheckboxPrimitive.Root.displayName;
|
|
31
|
-
|
|
32
|
-
/* -----------------------------------------------------------------------------
|
|
33
|
-
* Exports
|
|
34
|
-
* -------------------------------------------------------------------------- */
|
|
35
|
-
|
|
36
|
-
export { Checkbox, type CheckboxProps };
|
package/src/react/code.tsx
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------------------------------------------------
|
|
5
|
-
* Component: Code
|
|
6
|
-
* -------------------------------------------------------------------------- */
|
|
7
|
-
|
|
8
|
-
type CodeElement = HTMLElement;
|
|
9
|
-
|
|
10
|
-
interface CodeProps extends React.HTMLAttributes<HTMLElement> {
|
|
11
|
-
asChild?: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const Code = React.forwardRef<CodeElement, CodeProps>(({ asChild, ...props }, ref) => {
|
|
15
|
-
const Component = asChild ? Slot : 'code';
|
|
16
|
-
|
|
17
|
-
return <Component ref={ref} {...props} />;
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
Code.displayName = 'Code';
|
|
21
|
-
|
|
22
|
-
/* -----------------------------------------------------------------------------
|
|
23
|
-
* Exports
|
|
24
|
-
* -------------------------------------------------------------------------- */
|
|
25
|
-
|
|
26
|
-
export { Code, type CodeProps };
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
|
|
5
|
-
import { cn } from '../lib/utils';
|
|
6
|
-
|
|
7
|
-
/* -----------------------------------------------------------------------------
|
|
8
|
-
* Component: Collapsible
|
|
9
|
-
* -------------------------------------------------------------------------- */
|
|
10
|
-
|
|
11
|
-
type CollapsibleProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Root>;
|
|
12
|
-
const Collapsible = CollapsiblePrimitive.Root;
|
|
13
|
-
|
|
14
|
-
/* -----------------------------------------------------------------------------
|
|
15
|
-
* Component: CollapsibleTrigger
|
|
16
|
-
* -------------------------------------------------------------------------- */
|
|
17
|
-
|
|
18
|
-
type CollapsibleTriggerProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.CollapsibleTrigger>;
|
|
19
|
-
const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
|
|
20
|
-
|
|
21
|
-
/* -----------------------------------------------------------------------------
|
|
22
|
-
* Component: CollapsibleContent
|
|
23
|
-
* -------------------------------------------------------------------------- */
|
|
24
|
-
|
|
25
|
-
type CollapsibleContentElement = React.ElementRef<typeof CollapsiblePrimitive.CollapsibleContent>;
|
|
26
|
-
type CollapsibleContentProps = React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.CollapsibleContent>;
|
|
27
|
-
|
|
28
|
-
const CollapsibleContent = React.forwardRef<CollapsibleContentElement, CollapsibleContentProps>(
|
|
29
|
-
({ className, ...props }, ref) => (
|
|
30
|
-
<CollapsiblePrimitive.CollapsibleContent
|
|
31
|
-
ref={ref}
|
|
32
|
-
className={cn(
|
|
33
|
-
'data-[state=open]:animate-collapsible-open data-[state=closed]:animate-collapsible-closed overflow-hidden',
|
|
34
|
-
className,
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
/>
|
|
38
|
-
),
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
CollapsibleContent.displayName = CollapsiblePrimitive.CollapsibleContent.displayName;
|
|
42
|
-
|
|
43
|
-
/* -----------------------------------------------------------------------------
|
|
44
|
-
* Exports
|
|
45
|
-
* -------------------------------------------------------------------------- */
|
|
46
|
-
|
|
47
|
-
export {
|
|
48
|
-
Collapsible,
|
|
49
|
-
CollapsibleTrigger,
|
|
50
|
-
CollapsibleContent,
|
|
51
|
-
type CollapsibleProps,
|
|
52
|
-
type CollapsibleTriggerProps,
|
|
53
|
-
type CollapsibleContentProps,
|
|
54
|
-
};
|
package/src/react/command.tsx
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import * as React from 'react';
|
|
4
|
-
import { MagnifyingGlassIcon } from '@radix-ui/react-icons';
|
|
5
|
-
import { Command as CommandPrimitive } from 'cmdk';
|
|
6
|
-
import { cn } from '../lib/utils';
|
|
7
|
-
import { Dialog, DialogContent } from './dialog';
|
|
8
|
-
|
|
9
|
-
/* -----------------------------------------------------------------------------
|
|
10
|
-
* Component: Command
|
|
11
|
-
* -------------------------------------------------------------------------- */
|
|
12
|
-
|
|
13
|
-
type CommandElement = React.ElementRef<typeof CommandPrimitive>;
|
|
14
|
-
type CommandProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive>;
|
|
15
|
-
|
|
16
|
-
const Command = React.forwardRef<CommandElement, CommandProps>(({ className, ...props }, ref) => (
|
|
17
|
-
<CommandPrimitive
|
|
18
|
-
ref={ref}
|
|
19
|
-
className={cn(
|
|
20
|
-
'bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md',
|
|
21
|
-
className,
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
Command.displayName = CommandPrimitive.displayName;
|
|
28
|
-
|
|
29
|
-
/* -----------------------------------------------------------------------------
|
|
30
|
-
* Component: CommandDialog
|
|
31
|
-
* -------------------------------------------------------------------------- */
|
|
32
|
-
|
|
33
|
-
type CommandDialogProps = React.ComponentProps<typeof Dialog>;
|
|
34
|
-
|
|
35
|
-
function CommandDialog({ children, ...props }: CommandDialogProps): React.JSX.Element {
|
|
36
|
-
return (
|
|
37
|
-
<Dialog {...props}>
|
|
38
|
-
<DialogContent className="p-0">
|
|
39
|
-
<Command className="[&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:size-5">
|
|
40
|
-
{children}
|
|
41
|
-
</Command>
|
|
42
|
-
</DialogContent>
|
|
43
|
-
</Dialog>
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* -----------------------------------------------------------------------------
|
|
48
|
-
* Component: CommandInput
|
|
49
|
-
* -------------------------------------------------------------------------- */
|
|
50
|
-
|
|
51
|
-
type CommandInputElement = React.ElementRef<typeof CommandPrimitive.Input>;
|
|
52
|
-
type CommandInputProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>;
|
|
53
|
-
|
|
54
|
-
const CommandInput = React.forwardRef<CommandInputElement, CommandInputProps>(({ className, ...props }, ref) => (
|
|
55
|
-
<div className="flex items-center gap-2 border-b px-3" cmdk-input-wrapper="">
|
|
56
|
-
<MagnifyingGlassIcon className="size-5 shrink-0 opacity-50" />
|
|
57
|
-
<CommandPrimitive.Input
|
|
58
|
-
ref={ref}
|
|
59
|
-
className={cn(
|
|
60
|
-
'placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent text-sm outline-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
61
|
-
className,
|
|
62
|
-
)}
|
|
63
|
-
{...props}
|
|
64
|
-
/>
|
|
65
|
-
</div>
|
|
66
|
-
));
|
|
67
|
-
|
|
68
|
-
CommandInput.displayName = CommandPrimitive.Input.displayName;
|
|
69
|
-
|
|
70
|
-
/* -----------------------------------------------------------------------------
|
|
71
|
-
* Component: CommandList
|
|
72
|
-
* -------------------------------------------------------------------------- */
|
|
73
|
-
|
|
74
|
-
type CommandListElement = React.ElementRef<typeof CommandPrimitive.List>;
|
|
75
|
-
type CommandListProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>;
|
|
76
|
-
|
|
77
|
-
const CommandList = React.forwardRef<CommandListElement, CommandListProps>(({ className, ...props }, ref) => (
|
|
78
|
-
<CommandPrimitive.List ref={ref} className={cn('max-h-72 overflow-y-auto overflow-x-hidden', className)} {...props} />
|
|
79
|
-
));
|
|
80
|
-
|
|
81
|
-
CommandList.displayName = CommandPrimitive.List.displayName;
|
|
82
|
-
|
|
83
|
-
/* -----------------------------------------------------------------------------
|
|
84
|
-
* Component: CommandEmpty
|
|
85
|
-
* -------------------------------------------------------------------------- */
|
|
86
|
-
|
|
87
|
-
type CommandEmptyElement = React.ElementRef<typeof CommandPrimitive.Empty>;
|
|
88
|
-
type CommandEmptyProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>;
|
|
89
|
-
|
|
90
|
-
const CommandEmpty = React.forwardRef<CommandEmptyElement, CommandEmptyProps>((props, ref) => (
|
|
91
|
-
<CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} />
|
|
92
|
-
));
|
|
93
|
-
|
|
94
|
-
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
95
|
-
|
|
96
|
-
/* -----------------------------------------------------------------------------
|
|
97
|
-
* Component: CommandGroup
|
|
98
|
-
* -------------------------------------------------------------------------- */
|
|
99
|
-
|
|
100
|
-
type CommandGroupElement = React.ElementRef<typeof CommandPrimitive.Group>;
|
|
101
|
-
type CommandGroupProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>;
|
|
102
|
-
|
|
103
|
-
const CommandGroup = React.forwardRef<CommandGroupElement, CommandGroupProps>(({ className, ...props }, ref) => (
|
|
104
|
-
<CommandPrimitive.Group
|
|
105
|
-
ref={ref}
|
|
106
|
-
className={cn(
|
|
107
|
-
'text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium',
|
|
108
|
-
className,
|
|
109
|
-
)}
|
|
110
|
-
{...props}
|
|
111
|
-
/>
|
|
112
|
-
));
|
|
113
|
-
|
|
114
|
-
CommandGroup.displayName = CommandPrimitive.Group.displayName;
|
|
115
|
-
|
|
116
|
-
/* -----------------------------------------------------------------------------
|
|
117
|
-
* Component: CommandSeparator
|
|
118
|
-
* -------------------------------------------------------------------------- */
|
|
119
|
-
|
|
120
|
-
type CommandSeparatorElement = React.ElementRef<typeof CommandPrimitive.Separator>;
|
|
121
|
-
type CommandSeparatorProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>;
|
|
122
|
-
|
|
123
|
-
const CommandSeparator = React.forwardRef<CommandSeparatorElement, CommandSeparatorProps>(
|
|
124
|
-
({ className, ...props }, ref) => (
|
|
125
|
-
<CommandPrimitive.Separator ref={ref} className={cn('bg-border -mx-1 h-px', className)} {...props} />
|
|
126
|
-
),
|
|
127
|
-
);
|
|
128
|
-
|
|
129
|
-
CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
|
|
130
|
-
|
|
131
|
-
/* -----------------------------------------------------------------------------
|
|
132
|
-
* Component: CommandItem
|
|
133
|
-
* -------------------------------------------------------------------------- */
|
|
134
|
-
|
|
135
|
-
type CommandItemElement = React.ElementRef<typeof CommandPrimitive.Item>;
|
|
136
|
-
type CommandItemProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>;
|
|
137
|
-
|
|
138
|
-
const CommandItem = React.forwardRef<CommandItemElement, CommandItemProps>(({ className, ...props }, ref) => (
|
|
139
|
-
<CommandPrimitive.Item
|
|
140
|
-
ref={ref}
|
|
141
|
-
className={cn(
|
|
142
|
-
'aria-selected:bg-accent aria-selected:text-accent-foreground relative flex cursor-pointer select-none items-center rounded-sm px-2 py-1.5 text-sm aria-disabled:pointer-events-none aria-disabled:opacity-50 aria-selected:outline-none',
|
|
143
|
-
className,
|
|
144
|
-
)}
|
|
145
|
-
{...props}
|
|
146
|
-
/>
|
|
147
|
-
));
|
|
148
|
-
|
|
149
|
-
CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
150
|
-
|
|
151
|
-
/* -----------------------------------------------------------------------------
|
|
152
|
-
* Component: CommandLoading
|
|
153
|
-
* -------------------------------------------------------------------------- */
|
|
154
|
-
|
|
155
|
-
type CommandLoadingElement = React.ElementRef<typeof CommandPrimitive.Loading>;
|
|
156
|
-
type CommandLoadingProps = React.ComponentPropsWithoutRef<typeof CommandPrimitive.Loading>;
|
|
157
|
-
|
|
158
|
-
const CommandLoading = React.forwardRef<CommandLoadingElement, CommandLoadingProps>(({ className, ...props }, ref) => (
|
|
159
|
-
<CommandPrimitive.Loading ref={ref} className={cn('flex justify-center p-2', className)} {...props} />
|
|
160
|
-
));
|
|
161
|
-
|
|
162
|
-
CommandLoading.displayName = CommandPrimitive.Loading.displayName;
|
|
163
|
-
|
|
164
|
-
/* -----------------------------------------------------------------------------
|
|
165
|
-
* Component: CommandShortcut
|
|
166
|
-
* -------------------------------------------------------------------------- */
|
|
167
|
-
|
|
168
|
-
type CommandShortcutProps = React.HTMLAttributes<HTMLSpanElement>;
|
|
169
|
-
|
|
170
|
-
function CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element {
|
|
171
|
-
return <span className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)} {...props} />;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/* -----------------------------------------------------------------------------
|
|
175
|
-
* Exports
|
|
176
|
-
* -------------------------------------------------------------------------- */
|
|
177
|
-
|
|
178
|
-
export {
|
|
179
|
-
Command,
|
|
180
|
-
CommandDialog,
|
|
181
|
-
CommandInput,
|
|
182
|
-
CommandList,
|
|
183
|
-
CommandEmpty,
|
|
184
|
-
CommandGroup,
|
|
185
|
-
CommandItem,
|
|
186
|
-
CommandLoading,
|
|
187
|
-
CommandShortcut,
|
|
188
|
-
CommandSeparator,
|
|
189
|
-
type CommandProps,
|
|
190
|
-
type CommandDialogProps,
|
|
191
|
-
type CommandInputProps,
|
|
192
|
-
type CommandListProps,
|
|
193
|
-
type CommandEmptyProps,
|
|
194
|
-
type CommandGroupProps,
|
|
195
|
-
type CommandItemProps,
|
|
196
|
-
type CommandLoadingProps,
|
|
197
|
-
type CommandShortcutProps,
|
|
198
|
-
type CommandSeparatorProps,
|
|
199
|
-
};
|
package/src/react/container.tsx
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { Slot } from '@radix-ui/react-slot';
|
|
3
|
-
import { cn } from '../lib/utils';
|
|
4
|
-
|
|
5
|
-
/* -----------------------------------------------------------------------------
|
|
6
|
-
* Component: Container
|
|
7
|
-
* -------------------------------------------------------------------------- */
|
|
8
|
-
|
|
9
|
-
type ContainerElement = HTMLDivElement;
|
|
10
|
-
|
|
11
|
-
interface ContainerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
-
asChild?: boolean;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const Container = React.forwardRef<ContainerElement, ContainerProps>(({ className, asChild, ...props }, ref) => {
|
|
16
|
-
const Component = asChild ? Slot : 'div';
|
|
17
|
-
|
|
18
|
-
return <Component ref={ref} className={cn('container', className)} {...props} />;
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
Container.displayName = 'Container';
|
|
22
|
-
|
|
23
|
-
/* -----------------------------------------------------------------------------
|
|
24
|
-
* Exports
|
|
25
|
-
* -------------------------------------------------------------------------- */
|
|
26
|
-
|
|
27
|
-
export { Container, type ContainerProps };
|