@accelint/design-toolkit 2.5.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/index.d.ts +42 -0
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/avatar/index.d.ts +29 -0
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/badge/index.d.ts +24 -0
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/button/index.d.ts +104 -0
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +28 -106
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +6 -4
- package/dist/components/checkbox/index.d.ts +33 -0
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +3 -3
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +34 -0
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/classification-badge/index.d.ts +15 -0
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-banner/index.d.ts +11 -0
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/color-picker/styles.js +1 -1
- package/dist/components/color-picker/styles.js.map +1 -1
- package/dist/components/combobox-field/index.d.ts +19 -0
- package/dist/components/combobox-field/index.js +2 -0
- package/dist/components/combobox-field/index.js.map +1 -0
- package/dist/components/combobox-field/styles.d.ts +72 -0
- package/dist/components/combobox-field/styles.js +2 -0
- package/dist/components/combobox-field/styles.js.map +1 -0
- package/dist/components/combobox-field/types.d.ts +29 -0
- package/dist/components/date-field/index.d.ts +44 -0
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +3 -3
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/dialog/index.d.ts +26 -4
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/events.d.ts +8 -0
- package/dist/components/drawer/events.js +2 -0
- package/dist/components/drawer/events.js.map +1 -0
- package/dist/components/drawer/index.d.ts +89 -43
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/styles.d.ts +50 -16
- package/dist/components/drawer/styles.js +1 -1
- package/dist/components/drawer/styles.js.map +1 -1
- package/dist/components/drawer/types.d.ts +154 -238
- package/dist/components/drawer/types.js +1 -1
- package/dist/components/drawer/types.js.map +1 -1
- package/dist/components/hotkey/index.d.ts +56 -0
- package/dist/components/hotkey/index.js +2 -0
- package/dist/components/hotkey/index.js.map +1 -0
- package/dist/components/hotkey/styles.d.ts +53 -0
- package/dist/components/hotkey/styles.js +2 -0
- package/dist/components/hotkey/styles.js.map +1 -0
- package/dist/components/hotkey/types.d.ts +8 -0
- package/dist/components/hotkey/types.js +2 -0
- package/dist/components/hotkey/types.js.map +1 -0
- package/dist/components/icon/index.d.ts +29 -0
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/input/index.d.ts +19 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.d.ts +2 -24
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/input/types.d.ts +1 -0
- package/dist/components/label/index.d.ts +19 -0
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +69 -7
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.d.ts +19 -43
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/menu/types.d.ts +17 -15
- package/dist/components/options/index.d.ts +41 -0
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +3 -3
- package/dist/components/options/styles.js +1 -1
- package/dist/components/options/styles.js.map +1 -1
- package/dist/components/popover/index.d.ts +36 -2
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +24 -0
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/index.d.ts +31 -0
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +3 -3
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/search-field/styles.js +1 -1
- package/dist/components/search-field/styles.js.map +1 -1
- package/dist/components/search-field/types.d.ts +1 -0
- package/dist/components/select-field/index.d.ts +67 -0
- package/dist/components/select-field/index.js +2 -0
- package/dist/components/select-field/index.js.map +1 -0
- package/dist/components/select-field/styles.d.ts +60 -0
- package/dist/components/select-field/styles.js +2 -0
- package/dist/components/select-field/styles.js.map +1 -0
- package/dist/components/select-field/types.d.ts +27 -0
- package/dist/components/select-field/types.js +2 -0
- package/dist/components/select-field/types.js.map +1 -0
- package/dist/components/slider/index.d.ts +36 -2
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +36 -0
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +23 -21
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +1 -0
- package/dist/components/tabs/index.d.ts +46 -0
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +20 -0
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +3 -3
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-field/index.d.ts +62 -0
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +3 -3
- package/dist/components/text-field/types.d.ts +1 -0
- package/dist/components/tooltip/index.d.ts +42 -0
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/view-stack/events.d.ts +9 -0
- package/dist/components/view-stack/events.js +2 -0
- package/dist/components/view-stack/events.js.map +1 -0
- package/dist/components/view-stack/index.d.ts +31 -0
- package/dist/components/view-stack/index.js +2 -0
- package/dist/components/view-stack/index.js.map +1 -0
- package/dist/components/view-stack/types.d.ts +62 -0
- package/dist/components/view-stack/types.js +2 -0
- package/dist/components/view-stack/types.js.map +1 -0
- package/dist/index.css +20 -0
- package/dist/index.d.ts +24 -17
- package/dist/index.js +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +1081 -676
- package/dist/variants/variants.css +6 -5
- package/package.json +11 -6
- package/dist/components/box/index.d.ts +0 -19
- package/dist/components/box/index.js +0 -2
- package/dist/components/box/index.js.map +0 -1
- package/dist/components/combobox/index.d.ts +0 -27
- package/dist/components/combobox/index.js +0 -2
- package/dist/components/combobox/index.js.map +0 -1
- package/dist/components/drawer/context.d.ts +0 -13
- package/dist/components/drawer/context.js +0 -2
- package/dist/components/drawer/context.js.map +0 -1
- package/dist/components/drawer/state.d.ts +0 -26
- package/dist/components/drawer/state.js +0 -2
- package/dist/components/drawer/state.js.map +0 -1
- package/dist/components/navigation-stack/index.d.ts +0 -20
- package/dist/components/navigation-stack/index.js +0 -2
- package/dist/components/navigation-stack/index.js.map +0 -1
- package/dist/components/navigation-stack/types.d.ts +0 -31
- /package/dist/components/{navigation-stack → combobox-field}/types.js +0 -0
- /package/dist/components/{navigation-stack → combobox-field}/types.js.map +0 -0
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { RefAttributes
|
|
2
|
-
import { MenuProps as MenuProps$1, PopoverProps, MenuItemProps as MenuItemProps$1, TextProps,
|
|
1
|
+
import { RefAttributes } from 'react';
|
|
2
|
+
import { MenuProps as MenuProps$1, PopoverProps, MenuItemProps as MenuItemProps$1, TextProps, MenuSectionProps as MenuSectionProps$1 } from 'react-aria-components';
|
|
3
|
+
import { VariantProps } from 'tailwind-variants';
|
|
3
4
|
import { IconProps } from '../icon/types.js';
|
|
4
|
-
import {
|
|
5
|
-
import 'tailwind-variants';
|
|
5
|
+
import { MenuStyles } from './styles.js';
|
|
6
6
|
|
|
7
|
-
type MenuProps<T> = MenuProps$1<T> &
|
|
7
|
+
type MenuProps<T> = Omit<MenuProps$1<T>, 'className'> & VariantProps<typeof MenuStyles> & RefAttributes<HTMLDivElement> & {
|
|
8
|
+
classNames?: {
|
|
9
|
+
menu?: MenuProps$1<T>['className'];
|
|
10
|
+
popover?: PopoverProps['className'];
|
|
11
|
+
};
|
|
12
|
+
popoverProps?: Omit<PopoverProps, 'children' | 'className'>;
|
|
13
|
+
};
|
|
8
14
|
type MenuItemProps = Omit<MenuItemProps$1, 'className'> & {
|
|
9
|
-
color?: 'info' | 'serious';
|
|
10
15
|
classNames?: {
|
|
11
16
|
item?: MenuItemProps$1['className'];
|
|
12
17
|
text?: TextProps['className'];
|
|
13
18
|
more?: IconProps['className'];
|
|
14
19
|
icon?: IconProps['className'];
|
|
15
|
-
|
|
20
|
+
hotkey?: string;
|
|
16
21
|
};
|
|
22
|
+
color?: 'info' | 'serious';
|
|
17
23
|
};
|
|
18
|
-
type MenuTriggerProps = MenuTriggerProps$1;
|
|
19
|
-
type SubmenuTriggerProps = SubmenuTriggerProps$1;
|
|
20
24
|
type MenuSectionProps<T> = Omit<MenuSectionProps$1<T>, 'className'> & {
|
|
21
|
-
header?: string;
|
|
22
25
|
classNames?: {
|
|
23
|
-
section?:
|
|
24
|
-
|
|
26
|
+
section?: MenuSectionProps$1<T>['className'];
|
|
27
|
+
header?: string;
|
|
25
28
|
};
|
|
29
|
+
title?: string;
|
|
26
30
|
};
|
|
27
|
-
type SeparatorProps = SeparatorProps$1;
|
|
28
|
-
type MenuTextProps = PropsWithChildren & TextProps;
|
|
29
31
|
|
|
30
|
-
export type { MenuItemProps, MenuProps, MenuSectionProps
|
|
32
|
+
export type { MenuItemProps, MenuProps, MenuSectionProps };
|
|
@@ -28,6 +28,47 @@ declare namespace OptionsItem {
|
|
|
28
28
|
var Content: typeof OptionsItemContent;
|
|
29
29
|
var Description: typeof OptionsItemDescription;
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Options - A flexible list component for selectable items with rich content
|
|
33
|
+
*
|
|
34
|
+
* Provides accessible list functionality with support for selection, sections,
|
|
35
|
+
* and rich item content including labels, descriptions, and icons. Perfect for
|
|
36
|
+
* dropdown lists, menu items, or any selectable list interface.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* // Basic options list
|
|
40
|
+
* <Options>
|
|
41
|
+
* <Options.Item>
|
|
42
|
+
* <Options.Item.Label>Option 1</Options.Item.Label>
|
|
43
|
+
* </Options.Item>
|
|
44
|
+
* <Options.Item>
|
|
45
|
+
* <Options.Item.Label>Option 2</Options.Item.Label>
|
|
46
|
+
* </Options.Item>
|
|
47
|
+
* </Options>
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Options with descriptions and icons
|
|
51
|
+
* <Options>
|
|
52
|
+
* <Options.Item>
|
|
53
|
+
* <Icon><User /></Icon>
|
|
54
|
+
* <Options.Item.Content>
|
|
55
|
+
* <Options.Item.Label>John Doe</Options.Item.Label>
|
|
56
|
+
* <Options.Item.Description>Senior Developer</Options.Item.Description>
|
|
57
|
+
* </Options.Item.Content>
|
|
58
|
+
* </Options.Item>
|
|
59
|
+
* </Options>
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Sectioned options
|
|
63
|
+
* <Options>
|
|
64
|
+
* <Options.Section header="Recent">
|
|
65
|
+
* <Options.Item>Recent Item 1</Options.Item>
|
|
66
|
+
* </Options.Section>
|
|
67
|
+
* <Options.Section header="All Items">
|
|
68
|
+
* <Options.Item>All Items 1</Options.Item>
|
|
69
|
+
* </Options.Section>
|
|
70
|
+
* </Options>
|
|
71
|
+
*/
|
|
31
72
|
declare function Options<T extends OptionsDataItem>({ ref, ...props }: OptionsProps<T>): react_jsx_runtime.JSX.Element;
|
|
32
73
|
declare namespace Options {
|
|
33
74
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["item","label","description","D","u","classNames","ListBoxSection","M","y","section","jsx","Header","o","headerClassNames","items","N","className","c","T","textValue","color","children","m","OptionsItemLabel","OptionsItemContent","OptionsItem","OptionsItemDescription","props","useContextProps","ref","OptionsContext","C","ListBox","f","composeRenderProps","size","Options","OptionsSection"],"mappings":"4SAsCE,MAAA,CAAA,IACA,CAAA,CAAA,CAAA,OACA,CAAA,CAAA,CAAAA,aAEA,CAAA,CAAA,CAAA,OACA,CAAA,CAAAC,CAAAA,IACA,CAAA,CAAA,CAAA,KAAA,CAAAC,CACF,YAII,CAAA,CACF,EAEFC,aAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAA,QAAAC,CAAAA,CACA,WACA,CAAA,CAAA,CAAA,MAEA,CAAA,CAAA,CAAA,KACGC,EAAA,CACC,CAAA,CAAA,OACAC,IAAA,CAAAC,cAAA,CAAA,CAAA,EAAWC,CAAQ,CAAE,CAAA,SAAWJ,CAAAA,CAAAA,CAAY,CAAA,SAE5C,CAAA,CAAA,EAAA,OAAAK,CAACC,EAAA,QAAO,CAAA,CAAAC,GAAWC,OAAiB,CAAE,CAAA,SAAWR,CAAAA,CAAAA,CAAY,CAAA,SAC1D,CAAA,CAAA,EAAA,MACH,CAAA,CACAK,CAAAA,QAAY,CAAA,CAAOI,CAAAA,CAAQ,CAAAF,GAAA,CAAAG,UAAA,CAAA,CAAA,KAAS,CAAA,CAAA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AA,CAAA,OAAA,CAAA,QAAoB,CAAA,OAClBkB,GAAkB,QAAA,CAAAF,IAAS,CAAA,CAE5BA,CAAAA,QAOA,YAAc,CAAA,CAAA,WAAA,CAAA,sBAEJG,CACtBC,CAAAA,CAAY,CAAA,CAAA,OAAA,CAAA,CAAA,CAAcC,CAAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["item","label","description","D","u","classNames","ListBoxSection","M","y","section","jsx","Header","o","headerClassNames","items","N","className","c","T","textValue","color","children","m","OptionsItemLabel","OptionsItemContent","OptionsItem","OptionsItemDescription","props","useContextProps","ref","OptionsContext","C","ListBox","f","composeRenderProps","size","Options","OptionsSection"],"mappings":"4SAsCE,MAAA,CAAA,IACA,CAAA,CAAA,CAAA,OACA,CAAA,CAAA,CAAAA,aAEA,CAAA,CAAA,CAAA,OACA,CAAA,CAAAC,CAAAA,IACA,CAAA,CAAA,CAAA,KAAA,CAAAC,CACF,YAII,CAAA,CACF,EAEFC,aAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAA,QAAAC,CAAAA,CACA,WACA,CAAA,CAAA,CAAA,MAEA,CAAA,CAAA,CAAA,KACGC,EAAA,CACC,CAAA,CAAA,OACAC,IAAA,CAAAC,cAAA,CAAA,CAAA,EAAWC,CAAQ,CAAE,CAAA,SAAWJ,CAAAA,CAAAA,CAAY,CAAA,SAE5C,CAAA,CAAA,EAAA,OAAAK,CAACC,EAAA,QAAO,CAAA,CAAAC,GAAWC,OAAiB,CAAE,CAAA,SAAWR,CAAAA,CAAAA,CAAY,CAAA,SAC1D,CAAA,CAAA,EAAA,MACH,CAAA,CACAK,CAAAA,QAAY,CAAA,CAAOI,CAAAA,CAAQ,CAAAF,GAAA,CAAAG,UAAA,CAAA,CAAA,KAAS,CAAA,CAAA,CACtC,QAGW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,+BAEC,CAAA,UAAW,C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A,CAAAA,QAOA,YAAc,CAAA,CAAA,WAAA,CAAA,sBAEJG,CACtBC,CAAAA,CAAY,CAAA,CAAA,OAAA,CAAA,CAAA,CAAcC,CAAAA,CA2CnB,WAA4C,CACjD,WAEF,CAAoB,CAClB,CAACC,GAAU,CAAA,CAAIC,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAc,CAAAC,eAEjE,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAAf,CAAW,WAAc,CAAA,CAAIW,CAAAA,IAE/C,CAAA,CAAA,CAAA,GACGK,EAAA,CACE,CAAA,CAAA,OACIH,GAAAA,CACLI,iBAAWC,CAAmBlB,CAAAA,CAAYA,SACjC,CAAAM,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAC,CACpB,CAAA,aACWa,CAAAA,CAEV,WACH,CAEJ,CACAC,SAAQ,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACd,CAAA,SACA,CAAA,CAAA,CAAA,IAAUC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Collection,\n type ContextValue,\n Header,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Text,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { OptionsStyles } from './styles';\nimport type {\n OptionsDataItem,\n OptionsItemProps,\n OptionsItemTextProps,\n OptionsProps,\n OptionsSectionProps,\n} from './types';\n\nconst {\n list,\n section,\n header: headerClassNames,\n item,\n content,\n icon,\n label,\n description,\n} = OptionsStyles();\n\nexport const OptionsContext =\n createContext<ContextValue<OptionsProps<OptionsDataItem>, HTMLDivElement>>(\n null,\n );\n\nfunction OptionsSection<T extends OptionsDataItem>({\n children,\n classNames,\n header,\n items,\n}: OptionsSectionProps<T>) {\n return (\n <ListBoxSection\n id={header}\n className={section({ className: classNames?.section })}\n >\n <Header className={headerClassNames({ className: classNames?.header })}>\n {header}\n </Header>\n <Collection items={items}>{children}</Collection>\n </ListBoxSection>\n );\n}\nOptionsSection.displayName = 'Options.Section';\n\nfunction OptionsItemContent({ className, ...rest }: OptionsItemTextProps) {\n return <div {...rest} className={content({ className })} />;\n}\nOptionsItemContent.displayName = 'Options.Item.Content';\n\nfunction OptionsItemLabel({ className, ...rest }: OptionsItemTextProps) {\n return <Text {...rest} slot='label' className={label({ className })} />;\n}\nOptionsItemLabel.displayName = 'Options.Item.Label';\n\nfunction OptionsItemDescription({ className, ...rest }: OptionsItemTextProps) {\n return (\n <Text {...rest} slot='description' className={description({ className })} />\n );\n}\nOptionsItemDescription.displayName = 'Options.Item.Description';\n\nfunction OptionsItem<T extends OptionsDataItem>({\n children,\n classNames,\n color = 'info',\n textValue = typeof children === 'string' ? children : '',\n ...rest\n}: OptionsItemProps<T>) {\n return (\n <ListBoxItem\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className }),\n )}\n textValue={textValue}\n data-color={color}\n >\n {composeRenderProps(children, (children) => (\n <Icon.Provider\n className={icon({ className: classNames?.icon })}\n size='small'\n >\n {typeof children === 'string' ? (\n <OptionsItemLabel>{children}</OptionsItemLabel>\n ) : (\n children\n )}\n </Icon.Provider>\n ))}\n </ListBoxItem>\n );\n}\nOptionsItem.displayName = 'Options.Item';\nOptionsItem.Label = OptionsItemLabel;\nOptionsItem.Content = OptionsItemContent;\nOptionsItem.Description = OptionsItemDescription;\n\n/**\n * Options - A flexible list component for selectable items with rich content\n *\n * Provides accessible list functionality with support for selection, sections,\n * and rich item content including labels, descriptions, and icons. Perfect for\n * dropdown lists, menu items, or any selectable list interface.\n *\n * @example\n * // Basic options list\n * <Options>\n * <Options.Item>\n * <Options.Item.Label>Option 1</Options.Item.Label>\n * </Options.Item>\n * <Options.Item>\n * <Options.Item.Label>Option 2</Options.Item.Label>\n * </Options.Item>\n * </Options>\n *\n * @example\n * // Options with descriptions and icons\n * <Options>\n * <Options.Item>\n * <Icon><User /></Icon>\n * <Options.Item.Content>\n * <Options.Item.Label>John Doe</Options.Item.Label>\n * <Options.Item.Description>Senior Developer</Options.Item.Description>\n * </Options.Item.Content>\n * </Options.Item>\n * </Options>\n *\n * @example\n * // Sectioned options\n * <Options>\n * <Options.Section header=\"Recent\">\n * <Options.Item>Recent Item 1</Options.Item>\n * </Options.Section>\n * <Options.Section header=\"All Items\">\n * <Options.Item>All Items 1</Options.Item>\n * </Options.Section>\n * </Options>\n */\nexport function Options<T extends OptionsDataItem>({\n ref,\n ...props\n}: OptionsProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, OptionsContext);\n\n const { children, className, size, ...rest } = props;\n\n return (\n <ListBox<T>\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n list({ className }),\n )}\n data-size={size}\n >\n {children}\n </ListBox>\n );\n}\nOptions.displayName = 'Options';\nOptions.Item = OptionsItem;\nOptions.Section = OptionsSection;\n"]}
|
|
@@ -6,10 +6,10 @@ declare const OptionsStyles: tailwind_variants.TVReturnType<{
|
|
|
6
6
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
7
|
icon?: tailwind_merge.ClassNameValue;
|
|
8
8
|
content?: tailwind_merge.ClassNameValue;
|
|
9
|
+
list?: tailwind_merge.ClassNameValue;
|
|
9
10
|
header?: tailwind_merge.ClassNameValue;
|
|
10
11
|
label?: tailwind_merge.ClassNameValue;
|
|
11
12
|
section?: tailwind_merge.ClassNameValue;
|
|
12
|
-
list?: tailwind_merge.ClassNameValue;
|
|
13
13
|
description?: tailwind_merge.ClassNameValue;
|
|
14
14
|
item?: tailwind_merge.ClassNameValue;
|
|
15
15
|
};
|
|
@@ -19,10 +19,10 @@ declare const OptionsStyles: tailwind_variants.TVReturnType<{
|
|
|
19
19
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
20
20
|
icon?: tailwind_merge.ClassNameValue;
|
|
21
21
|
content?: tailwind_merge.ClassNameValue;
|
|
22
|
+
list?: tailwind_merge.ClassNameValue;
|
|
22
23
|
header?: tailwind_merge.ClassNameValue;
|
|
23
24
|
label?: tailwind_merge.ClassNameValue;
|
|
24
25
|
section?: tailwind_merge.ClassNameValue;
|
|
25
|
-
list?: tailwind_merge.ClassNameValue;
|
|
26
26
|
description?: tailwind_merge.ClassNameValue;
|
|
27
27
|
item?: tailwind_merge.ClassNameValue;
|
|
28
28
|
};
|
|
@@ -41,10 +41,10 @@ declare const OptionsStyles: tailwind_variants.TVReturnType<{
|
|
|
41
41
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
42
42
|
icon?: tailwind_merge.ClassNameValue;
|
|
43
43
|
content?: tailwind_merge.ClassNameValue;
|
|
44
|
+
list?: tailwind_merge.ClassNameValue;
|
|
44
45
|
header?: tailwind_merge.ClassNameValue;
|
|
45
46
|
label?: tailwind_merge.ClassNameValue;
|
|
46
47
|
section?: tailwind_merge.ClassNameValue;
|
|
47
|
-
list?: tailwind_merge.ClassNameValue;
|
|
48
48
|
description?: tailwind_merge.ClassNameValue;
|
|
49
49
|
item?: tailwind_merge.ClassNameValue;
|
|
50
50
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'tailwind-variants';const i=tv({slots:{list:"group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",section:"mt-s",header:"m-xs my-s text-default-dark text-header-xs",item:["group/options-item fg-default-light flex items-center gap-s p-s text-body-s","group-size-small/options:pt-xs group-size-small/options:pb-xs","group-size-large/options:pt-s group-size-large/options:pb-s","enabled:cursor-pointer","enabled:hover:fg-inverse-light","enabled:focus:fg-inverse-light","enabled:focus:color-info:bg-highlight-bold","enabled:hover:color-info:bg-highlight-bold","enabled:hover:color-serious:bg-serious-bold","enabled:focus:color-serious:bg-serious-bold","disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent"],content:"flex min-w-0 flex-auto flex-col gap-xxs",icon:["group-enabled/options-item:group-color-info/options-item:fg-default-light","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-color-serious/options-item:fg-serious","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-serious/options-item:fg-inverse-light"],label:["truncate","group-enabled/options-item:group-color-info/options-item:fg-default-light","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-color-serious/options-item:fg-serious","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-serious/options-item:fg-inverse-light"],description:["group-enabled/options-item:fg-default-dark truncate text-body-xs","group-enabled/options-item:group-hover/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:fg-inverse-light","group-disabled/options-item:fg-disabled"]}});export{i as OptionsStyles};//# sourceMappingURL=styles.js.map
|
|
1
|
+
import {tv}from'tailwind-variants';const i=tv({slots:{list:"group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",section:"mt-s",header:"m-xs my-s text-default-dark text-header-xs",item:["group/options-item fg-default-light flex items-center gap-s p-s text-body-s outline outline-transparent","group-size-small/options:pt-xs group-size-small/options:pb-xs","group-size-large/options:pt-s group-size-large/options:pb-s","enabled:cursor-pointer","enabled:hover:fg-inverse-light","enabled:focus-visible:fg-inverse-light enabled:focus-visible:outline-interactive-hover","enabled:focus-visible:color-info:bg-highlight-bold","enabled:hover:color-info:bg-highlight-bold","enabled:hover:color-serious:bg-serious-bold","enabled:focus-visible:color-serious:bg-serious-bold","disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent"],content:"flex min-w-0 flex-auto flex-col gap-xxs",icon:["group-enabled/options-item:group-color-info/options-item:fg-default-light","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-color-serious/options-item:fg-serious","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light","group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-inverse-light"],label:["truncate","group-enabled/options-item:group-color-info/options-item:fg-default-light","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-color-serious/options-item:fg-serious","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light","group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-inverse-light"],description:["group-enabled/options-item:fg-default-dark truncate text-body-xs","group-enabled/options-item:group-hover/options-item:fg-inverse-light","group-enabled/options-item:group-focus-visible/options-item:fg-inverse-light","group-disabled/options-item:fg-disabled"]}});export{i as OptionsStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/options/styles.ts"],"names":["OptionsStyles","tv"],"mappings":"mCAcO,MAAMA,CAAAA,CAAgBC,EAAAA,CAAG,CAC9B,KAAA,CAAO,CACL,IAAA,CAAM,qJAAA,CACN,OAAA,CAAS,MAAA,CACT,MAAA,CAAQ,4CAAA,CACR,IAAA,CAAM,CACJ,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/options/styles.ts"],"names":["OptionsStyles","tv"],"mappings":"mCAcO,MAAMA,CAAAA,CAAgBC,EAAAA,CAAG,CAC9B,KAAA,CAAO,CACL,IAAA,CAAM,qJAAA,CACN,OAAA,CAAS,MAAA,CACT,MAAA,CAAQ,4CAAA,CACR,IAAA,CAAM,CACJ,yGAAA,CACA,+DAAA,CACA,6DAAA,CACA,wBAAA,CACA,gCAAA,CACA,wFAAA,CACA,oDAAA,CACA,4CAAA,CACA,6CAAA,CACA,qDAAA,CACA,0EACF,CAAA,CACA,QAAS,yCAAA,CACT,IAAA,CAAM,CACJ,2EAAA,CACA,oGAAA,CACA,4GAAA,CACA,wEAAA,CACA,uGAAA,CACA,+GACF,CAAA,CACA,KAAA,CAAO,CACL,UAAA,CACA,2EAAA,CACA,oGAAA,CACA,4GAAA,CACA,wEAAA,CACA,uGAAA,CACA,+GACF,CAAA,CACA,WAAA,CAAa,CACX,kEAAA,CACA,sEAAA,CACA,8EAAA,CACA,yCACF,CACF,CACF,CAAC","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from 'tailwind-variants';\n\nexport const OptionsStyles = tv({\n slots: {\n list: 'group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light',\n section: 'mt-s',\n header: 'm-xs my-s text-default-dark text-header-xs',\n item: [\n 'group/options-item fg-default-light flex items-center gap-s p-s text-body-s outline outline-transparent',\n 'group-size-small/options:pt-xs group-size-small/options:pb-xs',\n 'group-size-large/options:pt-s group-size-large/options:pb-s',\n 'enabled:cursor-pointer',\n 'enabled:hover:fg-inverse-light',\n 'enabled:focus-visible:fg-inverse-light enabled:focus-visible:outline-interactive-hover',\n 'enabled:focus-visible:color-info:bg-highlight-bold',\n 'enabled:hover:color-info:bg-highlight-bold',\n 'enabled:hover:color-serious:bg-serious-bold',\n 'enabled:focus-visible:color-serious:bg-serious-bold',\n 'disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent',\n ],\n content: 'flex min-w-0 flex-auto flex-col gap-xxs',\n icon: [\n 'group-enabled/options-item:group-color-info/options-item:fg-default-light',\n 'group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-color-serious/options-item:fg-serious',\n 'group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-inverse-light',\n ],\n label: [\n 'truncate',\n 'group-enabled/options-item:group-color-info/options-item:fg-default-light',\n 'group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-color-serious/options-item:fg-serious',\n 'group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus-visible/options-item:group-color-serious/options-item:fg-inverse-light',\n ],\n description: [\n 'group-enabled/options-item:fg-default-dark truncate text-body-xs',\n 'group-enabled/options-item:group-hover/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus-visible/options-item:fg-inverse-light',\n 'group-disabled/options-item:fg-disabled',\n ],\n },\n});\n"]}
|
|
@@ -3,6 +3,41 @@ import { ReactNode } from 'react';
|
|
|
3
3
|
import { PopoverProps, PopoverTitleProps, PopoverContentProps, PopoverBodyProps, PopoverTriggerProps } from './types.js';
|
|
4
4
|
import 'react-aria-components';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Popover - A floating content container positioned relative to a trigger element
|
|
8
|
+
*
|
|
9
|
+
* Provides accessible popover functionality with flexible positioning and content
|
|
10
|
+
* organization. Perfect for contextual information, menus, or supplementary content
|
|
11
|
+
* that appears on demand without interrupting the user's workflow.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* // Basic popover
|
|
15
|
+
* <Popover>
|
|
16
|
+
* <Popover.Trigger>
|
|
17
|
+
* <Button>Show Info</Button>
|
|
18
|
+
* </Popover.Trigger>
|
|
19
|
+
* <Popover.Content>
|
|
20
|
+
* <Popover.Body>
|
|
21
|
+
* <p>Additional information appears here</p>
|
|
22
|
+
* </Popover.Body>
|
|
23
|
+
* </Popover.Content>
|
|
24
|
+
* </Popover>
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Popover with title and actions
|
|
28
|
+
* <Popover placement="top">
|
|
29
|
+
* <Popover.Trigger>
|
|
30
|
+
* <Button>Options</Button>
|
|
31
|
+
* </Popover.Trigger>
|
|
32
|
+
* <Popover.Content>
|
|
33
|
+
* <Popover.Title>Quick Actions</Popover.Title>
|
|
34
|
+
* <Popover.Body>
|
|
35
|
+
* <Button>Edit</Button>
|
|
36
|
+
* <Button>Delete</Button>
|
|
37
|
+
* </Popover.Body>
|
|
38
|
+
* </Popover.Content>
|
|
39
|
+
* </Popover>
|
|
40
|
+
*/
|
|
6
41
|
declare const Popover: {
|
|
7
42
|
({ placement, children, ...rest }: PopoverProps): react_jsx_runtime.JSX.Element;
|
|
8
43
|
displayName: string;
|
|
@@ -27,6 +62,5 @@ declare const Popover: {
|
|
|
27
62
|
};
|
|
28
63
|
Trigger: ({ children, ...props }: PopoverTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
29
64
|
};
|
|
30
|
-
declare const PopoverTrigger: ({ children, ...props }: PopoverTriggerProps) => react_jsx_runtime.JSX.Element;
|
|
31
65
|
|
|
32
|
-
export { Popover
|
|
66
|
+
export { Popover };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import'client-only';import {DialogTrigger,
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {DialogTrigger,Popover,Dialog,Heading,Pressable}from'react-aria-components';import {PopoverStyles}from'./styles.js';const {content:c,body:y,title:N,footer:T}=PopoverStyles(),e=({placement:r="bottom",children:o,...p})=>jsx(DialogTrigger,{...p,children:o});e.displayName="Popover";const A=({children:r,...o})=>jsx(Pressable,{...o,children:r});e.displayName="Popover.Trigger";const i=({children:r,className:o,...p})=>jsx(Popover,{className:c({className:o}),...p,children:jsx(Dialog,{children:r})});i.displayName="Popover.Content";const a=({children:r,className:o,...p})=>jsx(Heading,{slot:"title",className:N({className:o}),...p,children:r});a.displayName="Popover.Title";const s=({children:r,className:o})=>jsx("div",{className:y({className:o}),children:r});s.displayName="Popover.Body";const P=({children:r,className:o})=>jsx("div",{className:T({className:o}),children:r});P.displayName="Popover.Footer",e.Title=a,e.Content=i,e.Body=s,e.Footer=P,e.Trigger=A;export{e as Popover};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["PopoverStyles","Popover","rest","jsx","t","n","props","g","l","PopoverContent","v","PopoverTitle","PopoverBody","PopoverFooter","PopoverTrigger"],"mappings":"mLAiCQ,MAAA,CAAA,OAAS,CAAA,CAAA,CAAA,YAAa,CAAA,CAAA,CAAA,MAAWA,CAAAA,CAAc,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/popover/index.tsx"],"names":["PopoverStyles","Popover","rest","jsx","t","n","props","g","l","PopoverContent","v","PopoverTitle","PopoverBody","P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GxB,CAAA,CAAA,CAAA,CAAA,oBAEF,CAAA,CACST,CAAAA,GAACC,GAAA,CAAA,KAAI,CAAA,CAAA,SAAoB,CAAA,CAAA,CAAA,CAAA,SAAW,CAAI,CAAA,CAAA,CAAA,CAAA,QAAS,CAE1DS,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,gBAEpB,CAAA,CAAA,CAAA,KACRZ,CAAQ,CAAA,CAAA,CAAA,CAAA,OACRA,CAAQ,CAAA,CAAA,CAAA,CAAA,IACRA,CAAQ,CAAA,CAAA,CAAA,CAAA,MACRA,CAAQ,CAAA,CAAA,CAAA,CAAA,OAAUa,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport type { ReactNode } from 'react';\nimport {\n Dialog as AriaDialog,\n DialogTrigger as AriaDialogTrigger,\n Heading as AriaHeading,\n Popover as AriaPopover,\n Pressable,\n} from 'react-aria-components';\n\nimport type {\n PopoverBodyProps,\n PopoverContentProps,\n PopoverProps,\n PopoverTitleProps,\n PopoverTriggerProps,\n} from './types';\n\nimport { PopoverStyles } from './styles';\n\nconst { content, body, title, footer } = PopoverStyles();\n\n/**\n * Popover - A floating content container positioned relative to a trigger element\n *\n * Provides accessible popover functionality with flexible positioning and content\n * organization. Perfect for contextual information, menus, or supplementary content\n * that appears on demand without interrupting the user's workflow.\n *\n * @example\n * // Basic popover\n * <Popover>\n * <Popover.Trigger>\n * <Button>Show Info</Button>\n * </Popover.Trigger>\n * <Popover.Content>\n * <Popover.Body>\n * <p>Additional information appears here</p>\n * </Popover.Body>\n * </Popover.Content>\n * </Popover>\n *\n * @example\n * // Popover with title and actions\n * <Popover placement=\"top\">\n * <Popover.Trigger>\n * <Button>Options</Button>\n * </Popover.Trigger>\n * <Popover.Content>\n * <Popover.Title>Quick Actions</Popover.Title>\n * <Popover.Body>\n * <Button>Edit</Button>\n * <Button>Delete</Button>\n * </Popover.Body>\n * </Popover.Content>\n * </Popover>\n */\nexport const Popover = ({\n placement = 'bottom',\n children,\n ...rest\n}: PopoverProps) => {\n return <AriaDialogTrigger {...rest}>{children}</AriaDialogTrigger>;\n};\nPopover.displayName = 'Popover';\n\nconst PopoverTrigger = ({ children, ...props }: PopoverTriggerProps) => {\n return <Pressable {...props}>{children}</Pressable>;\n};\nPopover.displayName = 'Popover.Trigger';\n\nconst PopoverContent = ({\n children,\n className,\n ...rest\n}: PopoverContentProps) => {\n return (\n <AriaPopover className={content({ className })} {...rest}>\n {/* @ts-expect-error package version mismatch TODO */}\n <AriaDialog>{children}</AriaDialog>\n </AriaPopover>\n );\n};\nPopoverContent.displayName = 'Popover.Content';\n\nconst PopoverTitle = ({ children, className, ...rest }: PopoverTitleProps) => {\n return (\n <AriaHeading slot='title' className={title({ className })} {...rest}>\n {children}\n </AriaHeading>\n );\n};\n\nPopoverTitle.displayName = 'Popover.Title';\n\nconst PopoverBody = ({ children, className }: PopoverBodyProps) => {\n return <div className={body({ className })}>{children}</div>;\n};\nPopoverBody.displayName = 'Popover.Body';\n\nconst PopoverFooter = ({\n children,\n className,\n}: { children: ReactNode; className?: string }) => {\n return <div className={footer({ className })}>{children}</div>;\n};\nPopoverFooter.displayName = 'Popover.Footer';\n\nPopover.Title = PopoverTitle;\nPopover.Content = PopoverContent;\nPopover.Body = PopoverBody;\nPopover.Footer = PopoverFooter;\nPopover.Trigger = PopoverTrigger;\n"]}
|
|
@@ -10,6 +10,30 @@ import { QueryBuilderProps } from './types.js';
|
|
|
10
10
|
import 'react';
|
|
11
11
|
import 'type-fest';
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* QueryBuilder - A visual interface for building complex database queries
|
|
15
|
+
*
|
|
16
|
+
* Provides an intuitive drag-and-drop interface for constructing database queries
|
|
17
|
+
* with support for multiple conditions, operators, and logical grouping. Enables
|
|
18
|
+
* users to build complex filters without writing SQL or code.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* // Basic query builder
|
|
22
|
+
* <QueryBuilder
|
|
23
|
+
* fields={[
|
|
24
|
+
* // { name, label, type, inputType, operators },
|
|
25
|
+
* ]}
|
|
26
|
+
* query={
|
|
27
|
+
* // { combinator, rules }
|
|
28
|
+
* }
|
|
29
|
+
* onQueryChange={handleQueryChange}
|
|
30
|
+
* controlElements={{
|
|
31
|
+
* addRuleAction: CustomAddButton,
|
|
32
|
+
* removeRuleAction: CustomRemoveButton
|
|
33
|
+
* }}
|
|
34
|
+
* orientation="vertical"
|
|
35
|
+
* />
|
|
36
|
+
*/
|
|
13
37
|
declare function QueryBuilder({ controlClassnames, controlElements, orientation, showRuleLines, ...rest }: QueryBuilderProps): react_jsx_runtime.JSX.Element;
|
|
14
38
|
declare namespace QueryBuilder {
|
|
15
39
|
var CombinatorSelector: ({ options, value, handleOnChange, }: CombinatorSelectorProps) => react_jsx_runtime.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/index.tsx"],"names":["jsx","Label","B","b","options","Radio","jsxs","Tooltip","e","z","m","operatorDescriptions","option","RemoveRuleAction","className","event","handleOnClick","pressToMouseEvent","handlePress","rest","p","Icon","u","LockAction","useCallback","T","CloneAction","k","QueryBuilder","c","Q","mergedElements","CombinatorSelector","s","defaultClassnames","R","A","y","P","h","g","RQBBuilder","D","V","mergedClassnames","Rule","RuleGroupFooterComponent","getValidationResult","N","ValueSelector"],"mappings":"4vBA2CM,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,0CAKJ,CAAA,EAAA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C,CAAAA,CAACyC,CAAAA,CAAA,CACC,CAAA,CAAAR,OAAA,CAAA,KAAA,CAAA,GAAA,CAAe,CAAA,GACf,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAS,aAAA,CAAA,CAAkB,WAClB,CAAA,CAAA,CAAA,aACA,CAAA,CAAA,CAAA,CAAA,CAAA,OAAAlC,GAAA,CAAAmC,YAAmBC,CAAAA,CACnB,aAAA,CAAA,KAAiBb,CAAAA,gBAEjB,CAAA,KAAA,CAAA,iBAMO,CAAA,KAAA,CAAA,iBACbH,CAAAA,CAAa,CAAA,eAAA,CAAmBf,CAAAA,CAChCe,OAAa,CAAA,CAAA,CAAA,aACA,CAAA,IAAA,CAAA,GAAcF,CAC3BE,CAAAA,CAAa,CAAA,CAAA,CAAA,kBACA,CAAA,CAAOiB,CAAAA,CACpBjB,CAAAA,gBACa,CAAA,CAAA,CAAA,CAAA,CAAA,UAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,CAAA,CAAA,aAAA,CAAAS,aAAA,CAAA,CAA2BS,CAAAA,IAC3B,CAAAV,IAAA,CAAA,CAAA,CAAA,SAAA,CAAAD,SAAA,CAAA,CAAA,CAAsBY,wBAEtB,CAAAC,wBAAA,CAAA,CAAA,CAAA,wBAAgBC,CAAAA,wBAAAA,CAAAA,CAAAA,CAAAA,mBAAAA,CAAAA,mBAAAA,CAAAA,CAAAA,CAAAA,WAAAA,CAAAA,WAAAA,CAAAA,CAAAA,CAAAA,aAAAA,CAAAA,aAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { Delete, Duplicate, LockFill } from '@accelint/icons';\nimport type { PressEvent } from '@react-types/shared';\nimport { createContext, useCallback, useMemo } from 'react';\nimport {\n type ActionProps,\n type Classnames,\n type CombinatorSelectorProps,\n QueryBuilder as RQBBuilder,\n} from 'react-querybuilder';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Radio } from '../radio';\nimport { Tooltip } from '../tooltip';\nimport { ActionElement } from './action-element';\nimport {\n RuleGroup,\n RuleGroupFooterComponent,\n RuleGroupHeaderComponent,\n} from './group';\nimport { Rule } from './rule';\nimport type { QueryBuilderContextType, QueryBuilderProps } from './types';\nimport { getValidationResult, pressToMouseEvent } from './utils';\nimport { ValueEditor } from './value-editor';\nimport { ValueSelector } from './value-selector';\n\nconst operatorDescriptions: Record<string, string> = {\n AND: 'All rules below must be true for a match',\n OR: 'One of the rules below must be true for a match',\n};\n\nfunction CombinatorSelector({\n options,\n value,\n handleOnChange,\n}: CombinatorSelectorProps) {\n return (\n <Radio.Group\n value={value}\n onChange={handleOnChange}\n orientation='horizontal'\n >\n <Label>Combinator</Label>\n {options.map((option) => (\n <Radio key={option.label} value={option.label}>\n <Tooltip>\n <Tooltip.Trigger>\n <span>{option.label}</span>\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {operatorDescriptions[option.label]}\n </Tooltip.Body>\n </Tooltip>\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nfunction RemoveRuleAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Delete />\n </Icon>\n </Button>\n );\n}\n\nfunction LockAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <LockFill />\n </Icon>\n </Button>\n );\n}\n\nfunction CloneAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Duplicate />\n </Icon>\n </Button>\n );\n}\n\nexport function QueryBuilder({\n controlClassnames,\n controlElements,\n orientation = 'horizontal',\n showRuleLines = true,\n ...rest\n}: QueryBuilderProps) {\n /**\n * Represents the list of available controls that the component can use as a custom\n * component override.Passed in as a map of our custom defaults, but can be\n * overridden by using the controlElements prop\n */\n const mergedElements = useMemo(\n () => ({\n combinatorSelector: CombinatorSelector,\n cloneGroupAction: CloneAction,\n cloneRuleAction: CloneAction,\n removeRuleAction: RemoveRuleAction,\n lockGroupAction: LockAction,\n lockRuleAction: LockAction,\n ruleGroup: RuleGroup,\n rule: Rule,\n actionElement: ActionElement,\n valueSelector: ValueSelector,\n valueEditor: ValueEditor,\n ...controlElements,\n }),\n [controlElements],\n );\n\n /**\n * Represents the list of available classnames that the component will recognize.\n * Passed in as a map as all the default styling, but can be overridden by using the\n * controlClassnames prop\n */\n const defaultClassnames: Partial<Classnames> = useMemo(\n () => ({\n queryBuilder: 'border border-transparent',\n ruleGroup:\n 'group col-span-full flex flex-col gap-s p-s border border-info rounded-medium',\n header: 'flex gap-s',\n body: cn(\n 'group grid gap-x-s empty:hidden',\n showRuleLines\n ? 'grid-cols-[10px_minmax(100px,_1fr)_min-content]'\n : 'grid-cols-[minmax(100px,_1fr)_min-content]',\n ),\n combinators: 'my-s',\n addRule: '',\n addGroup: '',\n cloneRule: 'fg-interactive hover:fg-interactive-hover',\n cloneGroup: 'fg-interactive hover:fg-interactive-hover',\n removeGroup: '',\n rule: cn(\n 'flex gap-xs py-s',\n orientation === 'vertical'\n ? 'flex-col'\n : 'min-height-[50px] items-start',\n ),\n fields: 'w-full',\n operators: '',\n value: 'w-full',\n removeRule: '',\n valid: '',\n invalid: '',\n disabled: '',\n lockRule: 'fg-interactive hover:fg-interactive-hover',\n lockGroup: 'fg-interactive hover:fg-interactive-hover',\n valueSource: '',\n valueListItem: '',\n }),\n [orientation, showRuleLines],\n );\n\n const mergedClassnames = useMemo(() => {\n return {\n ...defaultClassnames,\n ...controlClassnames,\n };\n }, [controlClassnames, defaultClassnames]);\n\n const QueryBuilderContext = createContext<QueryBuilderContextType>({\n orientation,\n showRuleLines,\n });\n\n return (\n <RQBBuilder\n showNotToggle={false}\n showShiftActions={false}\n enableDragAndDrop={false}\n controlClassnames={mergedClassnames}\n controlElements={mergedElements}\n context={QueryBuilderContext}\n listsAsArrays\n {...rest}\n />\n );\n}\n\nQueryBuilder.CombinatorSelector = CombinatorSelector;\nQueryBuilder.RemoveRuleAction = RemoveRuleAction;\nQueryBuilder.LockAction = LockAction;\nQueryBuilder.CloneAction = CloneAction;\nQueryBuilder.ActionElement = ActionElement;\nQueryBuilder.Rule = Rule;\nQueryBuilder.RuleGroup = RuleGroup;\nQueryBuilder.RuleGroupHeaderComponent = RuleGroupHeaderComponent;\nQueryBuilder.RuleGroupFooterComponent = RuleGroupFooterComponent;\nQueryBuilder.getValidationResult = getValidationResult;\nQueryBuilder.ValueEditor = ValueEditor;\nQueryBuilder.ValueSelector = ValueSelector;\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/query-builder/index.tsx"],"names":["jsx","Label","B","b","options","Radio","jsxs","Tooltip","e","z","m","operatorDescriptions","option","RemoveRuleAction","className","event","handleOnClick","pressToMouseEvent","handlePress","rest","p","Icon","u","LockAction","useCallback","T","CloneAction","k","QueryBuilder","c","Q","mergedElements","CombinatorSelector","s","defaultClassnames","R","A","y","P","h","g","RQBBuilder","D","V","mergedClassnames","Rule","RuleGroupFooterComponent","getValidationResult","N","ValueSelector"],"mappings":"4vBA2CM,MAAA,CAAA,CAAA,CAAA,GAAA,CAAA,0CAKJ,CAAA,EAAA,CAAA,iDAMI,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,OAAA,CAAY,CAAA,CAAA,KAAA,CAAA,CAAA,CAAA,cAEZA,CAACC,CAAAA,CAAA,CAAM,CAAA,OAAAC,IAAA,CAAAC,KAAA,CAAA,KAAA,CAAA,CAAA,KACNC,CAAAA,CAAQ,CAAA,QACNC,CAAAA,CAAA,CAAyB,WAAc,CAAA,YACtCC,CAACC,QACC,CAAA,CAAAC,GAAA,CAAAC,KAAAT,CAAAA,CAACO,QAAQ,CAAA,YACPP,CAAC,CAAA,CAAA,CAAA,CAAA,GAAA,CAAM,CAAA,EAAAQ,GAAA,CAAAL,KAAA,CAAA,CAAA,KAAO,CAAA,CAAA,CAAA,KAEhBH,CAAAA,QAAC,CAAaE,IAAA,CAAAQ,OAAA,CAAA,CAAA,QAAU,CAAA,CAAAF,GACrB,CAAAE,OAAA,CAAA,OAAAC,CAAqBC,CAAAA,QACxB,CAAAJ,GAAA,CACF,MARiB,CAAA,CAAA,QAe3B,CAAA,CAAA,CAAA,KAAA,CAASK,CAAAA,CAAiB,CAAE,CAAAL,GAAA,CAAAE,OAAA,CAAA,IAAA,CAAA,CAAA,SAAe,CAAA,KAAAI,CAAAA,QAEzC,CAAA,CAAA,CAAA,CAAA,CAAA,KACGC,CAAAA,CAAAA,CAAsBC,CAAAA,CAAcC,CAAAA,CAAkBF,CAAK,CAAC,CAAA,KAE/D,CAEA,CAAA,CAAA,CAAA,CAAA,CAAA,SAEI,CAAA,CAAA,CAAK,aACL,CAAA,CAAA,CAAQ,SACR,CAA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AAA,aAAAA,CAAAA,aAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { Delete, Duplicate, LockFill } from '@accelint/icons';\nimport type { PressEvent } from '@react-types/shared';\nimport { createContext, useCallback, useMemo } from 'react';\nimport {\n type ActionProps,\n type Classnames,\n type CombinatorSelectorProps,\n QueryBuilder as RQBBuilder,\n} from 'react-querybuilder';\nimport { cn } from '../../lib/utils';\nimport { Button } from '../button';\nimport { Icon } from '../icon';\nimport { Label } from '../label';\nimport { Radio } from '../radio';\nimport { Tooltip } from '../tooltip';\nimport { ActionElement } from './action-element';\nimport {\n RuleGroup,\n RuleGroupFooterComponent,\n RuleGroupHeaderComponent,\n} from './group';\nimport { Rule } from './rule';\nimport type { QueryBuilderContextType, QueryBuilderProps } from './types';\nimport { getValidationResult, pressToMouseEvent } from './utils';\nimport { ValueEditor } from './value-editor';\nimport { ValueSelector } from './value-selector';\n\nconst operatorDescriptions: Record<string, string> = {\n AND: 'All rules below must be true for a match',\n OR: 'One of the rules below must be true for a match',\n};\n\nfunction CombinatorSelector({\n options,\n value,\n handleOnChange,\n}: CombinatorSelectorProps) {\n return (\n <Radio.Group\n value={value}\n onChange={handleOnChange}\n orientation='horizontal'\n >\n <Label>Combinator</Label>\n {options.map((option) => (\n <Radio key={option.label} value={option.label}>\n <Tooltip>\n <Tooltip.Trigger>\n <span>{option.label}</span>\n </Tooltip.Trigger>\n <Tooltip.Body placement='top'>\n {operatorDescriptions[option.label]}\n </Tooltip.Body>\n </Tooltip>\n </Radio>\n ))}\n </Radio.Group>\n );\n}\n\nfunction RemoveRuleAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Delete />\n </Icon>\n </Button>\n );\n}\n\nfunction LockAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <LockFill />\n </Icon>\n </Button>\n );\n}\n\nfunction CloneAction({ handleOnClick, className, ...rest }: ActionProps) {\n // TODO: remove pressToMouseEvent when design-system is removed\n const handlePress = useCallback(\n (event: PressEvent) => handleOnClick(pressToMouseEvent(event)),\n [handleOnClick],\n );\n\n return (\n <Button\n size='small'\n variant='icon'\n onPress={handlePress}\n className={className}\n {...rest}\n >\n <Icon>\n <Duplicate />\n </Icon>\n </Button>\n );\n}\n\n/**\n * QueryBuilder - A visual interface for building complex database queries\n *\n * Provides an intuitive drag-and-drop interface for constructing database queries\n * with support for multiple conditions, operators, and logical grouping. Enables\n * users to build complex filters without writing SQL or code.\n *\n * @example\n * // Basic query builder\n * <QueryBuilder\n * fields={[\n * // { name, label, type, inputType, operators },\n * ]}\n * query={\n * // { combinator, rules }\n * }\n * onQueryChange={handleQueryChange}\n * controlElements={{\n * addRuleAction: CustomAddButton,\n * removeRuleAction: CustomRemoveButton\n * }}\n * orientation=\"vertical\"\n * />\n */\nexport function QueryBuilder({\n controlClassnames,\n controlElements,\n orientation = 'horizontal',\n showRuleLines = true,\n ...rest\n}: QueryBuilderProps) {\n /**\n * Represents the list of available controls that the component can use as a custom\n * component override.Passed in as a map of our custom defaults, but can be\n * overridden by using the controlElements prop\n */\n const mergedElements = useMemo(\n () => ({\n combinatorSelector: CombinatorSelector,\n cloneGroupAction: CloneAction,\n cloneRuleAction: CloneAction,\n removeRuleAction: RemoveRuleAction,\n lockGroupAction: LockAction,\n lockRuleAction: LockAction,\n ruleGroup: RuleGroup,\n rule: Rule,\n actionElement: ActionElement,\n valueSelector: ValueSelector,\n valueEditor: ValueEditor,\n ...controlElements,\n }),\n [controlElements],\n );\n\n /**\n * Represents the list of available classnames that the component will recognize.\n * Passed in as a map as all the default styling, but can be overridden by using the\n * controlClassnames prop\n */\n const defaultClassnames: Partial<Classnames> = useMemo(\n () => ({\n queryBuilder: 'border border-transparent',\n ruleGroup:\n 'group col-span-full flex flex-col gap-s p-s border border-info rounded-medium',\n header: 'flex gap-s',\n body: cn(\n 'group grid gap-x-s empty:hidden',\n showRuleLines\n ? 'grid-cols-[10px_minmax(100px,_1fr)_min-content]'\n : 'grid-cols-[minmax(100px,_1fr)_min-content]',\n ),\n combinators: 'my-s',\n addRule: '',\n addGroup: '',\n cloneRule: 'fg-interactive hover:fg-interactive-hover',\n cloneGroup: 'fg-interactive hover:fg-interactive-hover',\n removeGroup: '',\n rule: cn(\n 'flex gap-xs py-s',\n orientation === 'vertical'\n ? 'flex-col'\n : 'min-height-[50px] items-start',\n ),\n fields: 'w-full',\n operators: '',\n value: 'w-full',\n removeRule: '',\n valid: '',\n invalid: '',\n disabled: '',\n lockRule: 'fg-interactive hover:fg-interactive-hover',\n lockGroup: 'fg-interactive hover:fg-interactive-hover',\n valueSource: '',\n valueListItem: '',\n }),\n [orientation, showRuleLines],\n );\n\n const mergedClassnames = useMemo(() => {\n return {\n ...defaultClassnames,\n ...controlClassnames,\n };\n }, [controlClassnames, defaultClassnames]);\n\n const QueryBuilderContext = createContext<QueryBuilderContextType>({\n orientation,\n showRuleLines,\n });\n\n return (\n <RQBBuilder\n showNotToggle={false}\n showShiftActions={false}\n enableDragAndDrop={false}\n controlClassnames={mergedClassnames}\n controlElements={mergedElements}\n context={QueryBuilderContext}\n listsAsArrays\n {...rest}\n />\n );\n}\n\nQueryBuilder.CombinatorSelector = CombinatorSelector;\nQueryBuilder.RemoveRuleAction = RemoveRuleAction;\nQueryBuilder.LockAction = LockAction;\nQueryBuilder.CloneAction = CloneAction;\nQueryBuilder.ActionElement = ActionElement;\nQueryBuilder.Rule = Rule;\nQueryBuilder.RuleGroup = RuleGroup;\nQueryBuilder.RuleGroupHeaderComponent = RuleGroupHeaderComponent;\nQueryBuilder.RuleGroupFooterComponent = RuleGroupFooterComponent;\nQueryBuilder.getValidationResult = getValidationResult;\nQueryBuilder.ValueEditor = ValueEditor;\nQueryBuilder.ValueSelector = ValueSelector;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import'client-only';import {useCallback,useMemo}from'react';import {useValueSelector,isOptionGroupArray}from'react-querybuilder';import {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {useCallback,useMemo}from'react';import {useValueSelector,isOptionGroupArray}from'react-querybuilder';import {ComboBoxField}from'../combobox-field/index.js';import {Options}from'../options/index.js';function K(s){const{handleOnChange:n,disabled:m,listsAsArrays:p,options:l,multiple:d,title:u,validation:V,value:y,...c}=s,{onChange:i,val:o}=useValueSelector({handleOnChange:n,listsAsArrays:p,multiple:d,value:y}),b=useCallback(e=>{e&&i(`${e}`);},[i]),h=useMemo(()=>isOptionGroupArray(l)?l.map(e=>jsx(Options.Section,{header:e.label,children:e.options.map(t=>jsx(Options.Item,{id:t.name,children:t.label},t.name))},e.label)):l.map(e=>jsx(Options.Item,{textValue:e.label,id:e.name,children:e.label},e.name)),[l]);return jsx(ComboBoxField,{size:"small",isDisabled:m,...c,selectedKey:Array.isArray(o)?o[0]:o,"aria-labelledby":u,onSelectionChange:b,children:h})}export{K as ValueSelector};//# sourceMappingURL=value-selector.js.map
|
|
2
2
|
//# sourceMappingURL=value-selector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/value-selector.tsx"],"names":["multiple","title","validation","value","onChange","val","useValueSelector","handleOnChange","O","selection","S","options","useMemo","isOptionGroupArray","optionsProp","section","jsx","Options","C","r","option","a","A","disabled","handleSelectionChange"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/query-builder/value-selector.tsx"],"names":["multiple","title","validation","value","onChange","val","useValueSelector","handleOnChange","O","selection","S","options","useMemo","isOptionGroupArray","optionsProp","section","jsx","Options","C","r","option","a","A","disabled","handleSelectionChange"],"mappings":"sQA2BI,SAAA,CAAA,CAAA,CAAA,CAAA,CAAA,oBAEA,CAAA,CAAA,CAAA,QACA,CAAA,CAAA,CAAA,eACAA,CAAAA,OACAC,CAAAA,CACA,CAAA,QAAA,CAAA,CAAAC,MACA,CAAA,CAAAC,CAAAA,UAIM,CAAA,CAAA,CAAA,KAAA,CAAAC,CAAAA,CAAU,GAAA,CAAAC,CAAI,CAAA,CAAIC,CAAAA,CAAiB,QACzC,CAAA,CAAA,CAAA,GAAA,CAAA,CAAAC,CAAAA,CACAC,gCACA,CAAA,CAAA,CAAA,aACAL,CACF,CAAC,CAAA,QAG4B,CACrBM,CAAAA,CAAAA,KACO,CAAGA,CAAS,EAAE,CAE3B,CAAA,CACAC,WAACN,CAAQ,CACX,EAEMO,CAAAA,CAAUC,EACd,CAAA,CAAA,CAAA,EACEC,CAAmBC,CAAW,CAAA,EAC1BA,CAAAA,CAAY,IAAKC,CAAAA,CAAAA,CACfC,OAAAA,CAACC,IAAQC,kBAAA,CAAA,CAAA,CAAA,CAAA,CAAR,CAAoC,GAAA,CAAA,CAAA,EAAQH,GAAAA,CAAQI,eAClD,CAAA,CAAA,MAAQ,QAAQ,CAAA,QACdF,CAAAA,CAAQ,CAAA,OAAK,CAAIG,GAAO,CAAA,CAAA,EACtBC,GAAA,CAAAF,OAAA,CAAA,IAAA,CAAAC,GAAO,CAAA,CAAA,CAAA,IAD0BA,CAAO,QAFzBL,CAAAA,CAAQ,CAAA,KAO/B,CAAA,CACDD,CAAAA,CAAY,IAAKM,CAAAA,CAAAA,CACfJ,CAAAA,CAACC,MAAQ,CAAR,CACC,CAAA,CAAA,CAAA,GAAA,CAAA,CAAA,EAAWG,GAAAA,CAAOD,YAClB,CAAA,CAAA,SAGC,CAAA,CAAA,CAAA,KAAAC,CAAAA,SAFIA,CAAO,QAKrBN,CAAW,CACd,MAEA,CAAA,CAAA,CACEE,CAAAA,IACE,CAAA,CAAA,CAAA,CAAA,CAAK,CAAA,CAAA,CAAA,OACLK,GAAA,CAAAC,aAAA,CAAA,CAAA,IAAYC,mBAEC,CAAA,CAAA,CAAA,GAAM,CAAA,CAAA,WAAmB,CAAC,KACvC,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiBtB,CAAAA,CACjB,kBAAmBuB,CAAAA,CAElB,iBAGP,CAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAA,CAAA","file":"value-selector.js","sourcesContent":["// __private-exports\n/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport type { Key } from '@react-types/shared';\nimport { useCallback, useMemo } from 'react';\nimport {\n type ValueSelectorProps,\n isOptionGroupArray,\n useValueSelector,\n} from 'react-querybuilder';\nimport { ComboBoxField } from '../combobox-field';\nimport { Options } from '../options';\n\nexport function ValueSelector(props: ValueSelectorProps) {\n const {\n handleOnChange,\n disabled,\n listsAsArrays,\n options: optionsProp,\n multiple,\n title,\n validation,\n value,\n ...rest\n } = props;\n\n const { onChange, val } = useValueSelector({\n handleOnChange,\n listsAsArrays,\n multiple,\n value,\n });\n\n const handleSelectionChange = useCallback(\n (selection: Key | null) => {\n if (selection) {\n onChange(`${selection}`);\n }\n },\n [onChange],\n );\n\n const options = useMemo(\n () =>\n isOptionGroupArray(optionsProp)\n ? optionsProp.map((section) => (\n <Options.Section key={section.label} header={section.label}>\n {section.options.map((option) => (\n <Options.Item id={option.name} key={option.name}>\n {option.label}\n </Options.Item>\n ))}\n </Options.Section>\n ))\n : optionsProp.map((option) => (\n <Options.Item\n textValue={option.label}\n id={option.name}\n key={option.name}\n >\n {option.label}\n </Options.Item>\n )),\n [optionsProp],\n );\n\n return (\n <ComboBoxField\n size='small'\n isDisabled={disabled}\n {...rest}\n selectedKey={Array.isArray(val) ? val[0] : val}\n aria-labelledby={title}\n onSelectionChange={handleSelectionChange}\n >\n {options}\n </ComboBoxField>\n );\n}\n"]}
|
|
@@ -9,6 +9,37 @@ declare function RadioGroup({ ref, ...props }: RadioGroupProps): react_jsx_runti
|
|
|
9
9
|
declare namespace RadioGroup {
|
|
10
10
|
var displayName: string;
|
|
11
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* Radio - A form control for exclusive selection within a group of options
|
|
14
|
+
*
|
|
15
|
+
* Provides accessible radio button functionality where only one option can be
|
|
16
|
+
* selected at a time within a group. Includes proper labeling, keyboard navigation,
|
|
17
|
+
* and visual feedback for selection states.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // Basic radio group
|
|
21
|
+
* <Radio.Group label="Choose size">
|
|
22
|
+
* <Radio value="small">Small</Radio>
|
|
23
|
+
* <Radio value="medium">Medium</Radio>
|
|
24
|
+
* <Radio value="large">Large</Radio>
|
|
25
|
+
* </Radio.Group>
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Radio group with default selection
|
|
29
|
+
* <Radio.Group defaultValue="medium" label="Size preference">
|
|
30
|
+
* <Radio value="small">Small (S)</Radio>
|
|
31
|
+
* <Radio value="medium">Medium (M)</Radio>
|
|
32
|
+
* <Radio value="large">Large (L)</Radio>
|
|
33
|
+
* </Radio.Group>
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* // Disabled radio options
|
|
37
|
+
* <Radio.Group label="Shipping options">
|
|
38
|
+
* <Radio value="standard">Standard shipping</Radio>
|
|
39
|
+
* <Radio value="express">Express shipping</Radio>
|
|
40
|
+
* <Radio value="overnight" isDisabled>Overnight (unavailable)</Radio>
|
|
41
|
+
* </Radio.Group>
|
|
42
|
+
*/
|
|
12
43
|
declare function Radio({ classNames, children, ...rest }: RadioProps): react_jsx_runtime.JSX.Element;
|
|
13
44
|
declare namespace Radio {
|
|
14
45
|
var displayName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["groupLabel","RadioContext","x","G","props","useContextProps","ref","P","classNames","rest","AriaRadioGroup","b","composeRenderProps","className","group","children","i","isDisabled","isRequired","u","label","jsx","e","RadioGroup","AriaRadio","radio"],"mappings":"4QA0Be,MAAA,CAAA,KAAAA,CAAAA,CAAY,CAAA,UAAO,CAAA,CAAA,CAAA,KAAS,CAAA,CAAA,CAAA,OAAsB,EAEpDC,CAAAA,KACkD,CAAA,CAAI,CAAA,CAEnEC,WAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IAAsB,EAAA,SAAc,CAAoB,CACtD,CAACC,GAAU,CAAA,CAAIC,CAAAA,GAAuBC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAML,CAAY,CAAAM,eAE/D,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAAC,CAAAA,CAAY,CAAA,UAAUC,CAAK,EAAIL,KAEjD,CAAA,CAAA,CAAA,GACGM,CAAAA,CAAA,CACE,SACIJ,GAAAA,CACLK,UAAA,CAAA,CAAA,GAAA,CAAA,CAAA,GAAWC,CAAmBJ,CAAAA,CAAAA,SAAoBK,CAChDC,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEC,CAAAF,CAAAA,CAAmBG,CAAAA,CAAU,CAACA,QAAY,CAAAC,kBAAA,CAAA,CAAA,CAAA,CAAAC,CAAAA,CAAY,WAAAC,CAAW,CAAA,CAAA,UAE7D,CAAA,CAAA,CAAA,GAAAC,IAAAC,CAAAA,QAAAA,CACCC,CAAAA,QACE,CAAA,CAAA,CAAA,EAAAC,GAAWtB,CAAAA,KAAW,CAAE,CAAA,SAAWQ,CAAAA,CAAAA,CAAY,CAAA,SAC/C,CAAA,CAAA,EAAA,KAAYS,CAAAA,CACZ,CAAA,UAAYC,CAAAA,CAEX,CAAA,UACH,CAAA,CAEDH,CAAAA,QAMXQ,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/radio/index.tsx"],"names":["groupLabel","RadioContext","x","G","props","useContextProps","ref","P","classNames","rest","AriaRadioGroup","b","composeRenderProps","className","group","children","i","isDisabled","isRequired","u","label","jsx","e","RadioGroup","AriaRadio","radio"],"mappings":"4QA0Be,MAAA,CAAA,KAAAA,CAAAA,CAAY,CAAA,UAAO,CAAA,CAAA,CAAA,KAAS,CAAA,CAAA,CAAA,OAAsB,EAEpDC,CAAAA,KACkD,CAAA,CAAI,CAAA,CAEnEC,WAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IAAsB,EAAA,SAAc,CAAoB,CACtD,CAACC,GAAU,CAAA,CAAIC,CAAAA,GAAuBC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAML,CAAY,CAAAM,eAE/D,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAAC,CAAAA,CAAY,C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AWb,CAAAA,CAAAA,CAAY,CAAA,SAC7C,CAAA,CAAA,EAAA,KACH,CAAA,CAAA,CACF,QAKF,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACd,CAAA,OAAQe,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Radio as AriaRadio,\n RadioGroup as AriaRadioGroup,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { RadioStyles } from './styles';\nimport type { RadioGroupProps, RadioProps } from './types';\n\nconst { group, groupLabel, radio, control, label } = RadioStyles();\n\nexport const RadioContext =\n createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\n\nfunction RadioGroup({ ref, ...props }: RadioGroupProps) {\n [props, ref] = useContextProps(props, ref ?? null, RadioContext);\n\n const { children, classNames, label, ...rest } = props;\n\n return (\n <AriaRadioGroup\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.group, (className) =>\n group({ className }),\n )}\n >\n {composeRenderProps(children, (children, { isDisabled, isRequired }) => (\n <>\n {label && (\n <Label\n className={groupLabel({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {label}\n </Label>\n )}\n {children}\n </>\n ))}\n </AriaRadioGroup>\n );\n}\nRadioGroup.displayName = 'Radio.Group';\n\n/**\n * Radio - A form control for exclusive selection within a group of options\n *\n * Provides accessible radio button functionality where only one option can be\n * selected at a time within a group. Includes proper labeling, keyboard navigation,\n * and visual feedback for selection states.\n *\n * @example\n * // Basic radio group\n * <Radio.Group label=\"Choose size\">\n * <Radio value=\"small\">Small</Radio>\n * <Radio value=\"medium\">Medium</Radio>\n * <Radio value=\"large\">Large</Radio>\n * </Radio.Group>\n *\n * @example\n * // Radio group with default selection\n * <Radio.Group defaultValue=\"medium\" label=\"Size preference\">\n * <Radio value=\"small\">Small (S)</Radio>\n * <Radio value=\"medium\">Medium (M)</Radio>\n * <Radio value=\"large\">Large (L)</Radio>\n * </Radio.Group>\n *\n * @example\n * // Disabled radio options\n * <Radio.Group label=\"Shipping options\">\n * <Radio value=\"standard\">Standard shipping</Radio>\n * <Radio value=\"express\">Express shipping</Radio>\n * <Radio value=\"overnight\" isDisabled>Overnight (unavailable)</Radio>\n * </Radio.Group>\n */\nexport function Radio({ classNames, children, ...rest }: RadioProps) {\n return (\n <AriaRadio\n {...rest}\n className={composeRenderProps(classNames?.radio, (className) =>\n radio({ className }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n </>\n ))}\n </AriaRadio>\n );\n}\nRadio.displayName = 'Radio';\nRadio.Group = RadioGroup;\n"]}
|
|
@@ -4,9 +4,9 @@ import * as tailwind_merge from 'tailwind-merge';
|
|
|
4
4
|
declare const RadioStyles: tailwind_variants.TVReturnType<{
|
|
5
5
|
[key: string]: {
|
|
6
6
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
|
-
label?: tailwind_merge.ClassNameValue;
|
|
8
7
|
group?: tailwind_merge.ClassNameValue;
|
|
9
8
|
radio?: tailwind_merge.ClassNameValue;
|
|
9
|
+
label?: tailwind_merge.ClassNameValue;
|
|
10
10
|
groupLabel?: tailwind_merge.ClassNameValue;
|
|
11
11
|
control?: tailwind_merge.ClassNameValue;
|
|
12
12
|
};
|
|
@@ -14,9 +14,9 @@ declare const RadioStyles: tailwind_variants.TVReturnType<{
|
|
|
14
14
|
} | {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
17
|
-
label?: tailwind_merge.ClassNameValue;
|
|
18
17
|
group?: tailwind_merge.ClassNameValue;
|
|
19
18
|
radio?: tailwind_merge.ClassNameValue;
|
|
19
|
+
label?: tailwind_merge.ClassNameValue;
|
|
20
20
|
groupLabel?: tailwind_merge.ClassNameValue;
|
|
21
21
|
control?: tailwind_merge.ClassNameValue;
|
|
22
22
|
};
|
|
@@ -30,9 +30,9 @@ declare const RadioStyles: tailwind_variants.TVReturnType<{
|
|
|
30
30
|
}, undefined, {
|
|
31
31
|
[key: string]: {
|
|
32
32
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
33
|
-
label?: tailwind_merge.ClassNameValue;
|
|
34
33
|
group?: tailwind_merge.ClassNameValue;
|
|
35
34
|
radio?: tailwind_merge.ClassNameValue;
|
|
35
|
+
label?: tailwind_merge.ClassNameValue;
|
|
36
36
|
groupLabel?: tailwind_merge.ClassNameValue;
|
|
37
37
|
control?: tailwind_merge.ClassNameValue;
|
|
38
38
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const r=tv({slots:{group:["group/radio-group flex gap-xs","orientation-horizontal:flex-wrap","orientation-vertical:flex-col"],groupLabel:"w-full",radio:["group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3","disabled:cursor-not-allowed"],control:["my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full","group-enabled/radio:group-focus/radio:outline-interactive-hover","group-enabled/radio:group-hover/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight","group-enabled/radio:group-selected/radio:group-focus/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover","group-disabled/radio:outline-interactive-disabled","group-disabled/radio:group-selected/radio:before:bg-interactive-disabled"],label:["text-body-s text-interactive-default","group-disabled/radio:text-interactive-disabled"]}});export{r as RadioStyles};//# sourceMappingURL=styles.js.map
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const r=tv({slots:{group:["group/radio-group flex gap-xs","orientation-horizontal:flex-wrap","orientation-vertical:flex-col"],groupLabel:"w-full",radio:["group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3","disabled:cursor-not-allowed"],control:["my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full","group-enabled/radio:group-focus-visible/radio:outline-interactive-hover","group-enabled/radio:group-hover/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight","group-enabled/radio:group-selected/radio:group-focus-visible/radio:outline-interactive-hover","group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover","group-disabled/radio:outline-interactive-disabled","group-disabled/radio:group-selected/radio:before:bg-interactive-disabled"],label:["text-body-s text-interactive-default","group-disabled/radio:text-interactive-disabled"]}});export{r as RadioStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/radio/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,KAAA,CAAA,CAAA,+BACA,CAAA,kEAGF,CAAA,CAAA,UACA,CAAA,QACE,CAAA,KAAA,CAAA,CAAA,qJACA,CAAA,6BAEO,CACP,kJACA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/radio/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,KAAA,CAAA,CAAA,+BACA,CAAA,kEAGF,CAAA,CAAA,UACA,CAAA,QACE,CAAA,KAAA,CAAA,CAAA,qJACA,CAAA,6BAEO,CACP,kJACA,CAAA,yEACA,CAAA,2LAEA,CAAA,8FACA,CAAA,sFACA,CAAA,mDACA,CAAA,yHAIA,CAAA,gDAGL,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const RadioStyles = tv({\n slots: {\n group: [\n 'group/radio-group flex gap-xs',\n 'orientation-horizontal:flex-wrap',\n 'orientation-vertical:flex-col',\n ],\n groupLabel: 'w-full',\n radio: [\n 'group/radio flex cursor-pointer items-center gap-m group-orientation-horizontal/radio-group:grow group-orientation-horizontal/radio-group:basis-1/3',\n 'disabled:cursor-not-allowed',\n ],\n control: [\n 'my-xxs flex size-l items-center justify-center rounded-full outline outline-interactive before:block before:size-s before:rounded-full',\n 'group-enabled/radio:group-focus-visible/radio:outline-interactive-hover',\n 'group-enabled/radio:group-hover/radio:outline-interactive-hover',\n 'group-enabled/radio:group-selected/radio:outline-highlight group-enabled/radio:group-selected/radio:before:bg-highlight',\n 'group-enabled/radio:group-selected/radio:group-focus-visible/radio:outline-interactive-hover',\n 'group-enabled/radio:group-selected/radio:group-hover/radio:outline-interactive-hover',\n 'group-disabled/radio:outline-interactive-disabled',\n 'group-disabled/radio:group-selected/radio:before:bg-interactive-disabled',\n ],\n label: [\n 'text-body-s text-interactive-default',\n 'group-disabled/radio:text-interactive-disabled',\n ],\n },\n});\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const i={variant:"outlined"},l=tv({slots:{field:["group/search-field fg-default-light flex items-center gap-s rounded-round p-s outline","focus-within:outline-highlight","hover:outline-interactive-hover","disabled:fg-disabled disabled:placeholder:fg-disabled disabled:cursor-not-allowed disabled:outline-interactive-disabled"],input:["hide-cancel block w-full font-display text-body-s outline-none","placeholder:text-default-dark","disabled:cursor-not-allowed"],clear:["fg-interactive cursor-pointer","focus:fg-interactive-hover","hover:fg-interactive-hover","group-empty/search-field:invisible group-disabled/search-field:invisible"],loading:"motion-safe:animate-spin",search:""},variants:{variant:{filled:{field:"bg-surface-raised outline-static-dark"},outlined:{field:"outline-interactive"}}},defaultVariants:i});export{l as SearchFieldStyles,i as SearchFieldStylesDefaults};//# sourceMappingURL=styles.js.map
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const i={variant:"outlined"},l=tv({slots:{field:["group/search-field fg-default-light flex items-center gap-s rounded-round p-s outline","focus-visible-within:outline-highlight","hover:outline-interactive-hover","disabled:fg-disabled disabled:placeholder:fg-disabled disabled:cursor-not-allowed disabled:outline-interactive-disabled"],input:["hide-cancel block w-full font-display text-body-s outline-none","placeholder:text-default-dark","disabled:cursor-not-allowed"],clear:["fg-interactive cursor-pointer","focus-visible:fg-interactive-hover","hover:fg-interactive-hover","group-empty/search-field:invisible group-disabled/search-field:invisible"],loading:"motion-safe:animate-spin",search:""},variants:{variant:{filled:{field:"bg-surface-raised outline-static-dark"},outlined:{field:"outline-interactive"}}},defaultVariants:i});export{l as SearchFieldStyles,i as SearchFieldStylesDefaults};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/search-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAAA,CACX,UAGE,CAAA,CAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,KAAA,CAAA,CAAA,uFACA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/search-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAAA,CACX,UAGE,CAAA,CAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KACE,CAAA,CAAA,KAAA,CAAA,CAAA,uFACA,CAAA,wCACA,CAAA,iCACA,CAAA,yHAGA,CAAA,CAAA,KAAA,CAAA,CAAA,gEACA,CAAA,+BACA,CAAA,6BAGA,CAAA,CAAA,KAAA,CAAA,CAAA,+BACA,CAAA,oCACA,CAAA,4BACA,CAAA,0EAEO,CAAA,CAAA,OAAA,CAAA,0BAEX,CAAA,MACA,CAAA,EAAA,CAAU,CACR,QAAS,CACP,CAAA,OACE,CAAA,CAAA,MAAO,CAAA,CAAA,KAAA,CAAA,uCAET,CAAU,CACR,QAAO,CAAA,CAAA,KAAA,CAAA,qBAIb,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const SearchFieldStylesDefaults = {\n variant: 'outlined',\n} as const;\n\nexport const SearchFieldStyles = tv({\n slots: {\n field: [\n 'group/search-field fg-default-light flex items-center gap-s rounded-round p-s outline',\n 'focus-visible-within:outline-highlight',\n 'hover:outline-interactive-hover',\n 'disabled:fg-disabled disabled:placeholder:fg-disabled disabled:cursor-not-allowed disabled:outline-interactive-disabled',\n ],\n input: [\n 'hide-cancel block w-full font-display text-body-s outline-none',\n 'placeholder:text-default-dark',\n 'disabled:cursor-not-allowed',\n ],\n clear: [\n 'fg-interactive cursor-pointer',\n 'focus-visible:fg-interactive-hover',\n 'hover:fg-interactive-hover',\n 'group-empty/search-field:invisible group-disabled/search-field:invisible',\n ],\n loading: 'motion-safe:animate-spin',\n search: '',\n },\n variants: {\n variant: {\n filled: {\n field: 'bg-surface-raised outline-static-dark',\n },\n outlined: {\n field: 'outline-interactive',\n },\n },\n },\n defaultVariants: SearchFieldStylesDefaults,\n});\n"]}
|
|
@@ -4,6 +4,7 @@ import { VariantProps } from 'tailwind-variants';
|
|
|
4
4
|
import { ButtonProps } from '../button/types.js';
|
|
5
5
|
import { IconProps } from '../icon/types.js';
|
|
6
6
|
import { SearchFieldStyles } from './styles.js';
|
|
7
|
+
import '../../lib/types.js';
|
|
7
8
|
import '../button/styles.js';
|
|
8
9
|
import 'tailwind-merge';
|
|
9
10
|
|