@accelint/design-system 0.12.5 → 0.12.6
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/aria/index.d.ts +8 -4
- package/dist/components/aria/index.js +25 -4
- package/dist/components/aria/index.js.map +1 -1
- package/dist/components/button/index.js +2 -2
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/collection/index.js +0 -2
- package/dist/components/collection/index.js.map +1 -1
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/index.d.ts +4 -4
- package/dist/components/index.js +3 -3
- package/dist/components/menu/index.js +3 -3
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/options/index.js +3 -3
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/picker/index.js +2 -2
- package/dist/components/picker/index.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +15 -15
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +6 -6
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { RefAttributes } from 'react';
|
|
3
3
|
import * as react_aria_components from 'react-aria-components';
|
|
4
|
-
import { ContextValue, SectionProps, SelectValueProps } from 'react-aria-components';
|
|
4
|
+
import { ContextValue, ListBoxSectionProps, MenuSectionProps, SectionProps, SelectValueProps, TextProps } from 'react-aria-components';
|
|
5
5
|
|
|
6
6
|
declare const AriaFieldError: (props: react_aria_components.FieldErrorProps & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
7
7
|
declare const AriaFieldErrorContext: react.Context<ContextValue<react_aria_components.FieldErrorProps & RefAttributes<HTMLElement>, HTMLElement>>;
|
|
@@ -17,16 +17,20 @@ declare const AriaLabel: (props: react_aria_components.LabelProps & RefAttribute
|
|
|
17
17
|
declare const AriaLabelContext: react.Context<ContextValue<react_aria_components.LabelProps & RefAttributes<HTMLLabelElement>, HTMLLabelElement>>;
|
|
18
18
|
declare const AriaSeparator: (props: react_aria_components.SeparatorProps & RefAttributes<object> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
19
19
|
declare const AriaSeparatorContext: react.Context<ContextValue<react_aria_components.SeparatorProps & RefAttributes<object>, HTMLElement>>;
|
|
20
|
-
declare const AriaText: (props: react_aria_components.TextProps & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
21
|
-
declare const AriaTextContext: react.Context<ContextValue<react_aria_components.TextProps & RefAttributes<HTMLElement>, HTMLElement>>;
|
|
22
20
|
/**
|
|
23
21
|
* Due to the complexity of types and technical constraints of TS, it's not
|
|
24
22
|
* possible for the above wrapping utility to support components that accept
|
|
25
23
|
* generic parameters. This means that these components must be manually wrapped
|
|
26
24
|
*/
|
|
25
|
+
declare const AriaMenuSectionContext: react.Context<ContextValue<MenuSectionProps<object>, HTMLElement>>;
|
|
26
|
+
declare const AriaMenuSection: <T extends object>(props: MenuSectionProps<T> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
27
|
+
declare const AriaListBoxSectionContext: react.Context<ContextValue<ListBoxSectionProps<object>, HTMLElement>>;
|
|
28
|
+
declare const AriaListBoxSection: <T extends object>(props: ListBoxSectionProps<T> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
27
29
|
declare const AriaSectionContext: react.Context<ContextValue<SectionProps<object>, HTMLElement>>;
|
|
28
30
|
declare const AriaSection: <T extends object>(props: SectionProps<T> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
29
31
|
declare const AriaSelectValueContext: react.Context<ContextValue<SelectValueProps<object>, HTMLSpanElement>>;
|
|
30
32
|
declare const AriaSelectValue: <T extends object>(props: SelectValueProps<T> & RefAttributes<HTMLSpanElement>) => react.ReactElement | null;
|
|
33
|
+
declare const AriaTextContext: react.Context<ContextValue<TextProps, HTMLElement>>;
|
|
34
|
+
declare const AriaText: (props: TextProps & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
31
35
|
|
|
32
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext };
|
|
36
|
+
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaListBoxSection, AriaListBoxSectionContext, AriaMenuSection, AriaMenuSectionContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import '../../chunk-PZ5AY32C.js';
|
|
2
2
|
import { createContext, forwardRef } from 'react';
|
|
3
|
-
import { Section, SelectValue, FieldError, Group, Header, Heading, Keyboard, Label, Separator
|
|
4
|
-
import { useContextProps } from '../../hooks/use-context-props/index.js';
|
|
3
|
+
import { useContextProps, MenuSection, ListBoxSection, Section, SelectValue, Text, FieldError, Group, Header, Heading, Keyboard, Label, Separator } from 'react-aria-components';
|
|
5
4
|
import { jsx } from 'react/jsx-runtime';
|
|
6
5
|
|
|
7
6
|
function wrap(Component) {
|
|
@@ -21,7 +20,24 @@ var { Component: AriaHeading, Context: AriaHeadingContext } = wrap(Heading);
|
|
|
21
20
|
var { Component: AriaKeyboard, Context: AriaKeyboardContext } = wrap(Keyboard);
|
|
22
21
|
var { Component: AriaLabel, Context: AriaLabelContext } = wrap(Label);
|
|
23
22
|
var { Component: AriaSeparator, Context: AriaSeparatorContext } = wrap(Separator);
|
|
24
|
-
var
|
|
23
|
+
var AriaMenuSectionContext = createContext(null);
|
|
24
|
+
var AriaMenuSection = forwardRef(function AriaMenuSection2(props, ref) {
|
|
25
|
+
const [mergedProps, mergedRef] = useContextProps(
|
|
26
|
+
props,
|
|
27
|
+
ref,
|
|
28
|
+
AriaMenuSectionContext
|
|
29
|
+
);
|
|
30
|
+
return /* @__PURE__ */ jsx(MenuSection, { ...mergedProps, ref: mergedRef });
|
|
31
|
+
});
|
|
32
|
+
var AriaListBoxSectionContext = createContext(null);
|
|
33
|
+
var AriaListBoxSection = forwardRef(function AriaListBoxSection2(props, ref) {
|
|
34
|
+
const [mergedProps, mergedRef] = useContextProps(
|
|
35
|
+
props,
|
|
36
|
+
ref,
|
|
37
|
+
AriaListBoxSectionContext
|
|
38
|
+
);
|
|
39
|
+
return /* @__PURE__ */ jsx(ListBoxSection, { ...mergedProps, ref: mergedRef });
|
|
40
|
+
});
|
|
25
41
|
var AriaSectionContext = createContext(null);
|
|
26
42
|
var AriaSection = forwardRef(function AriaSection2(props, ref) {
|
|
27
43
|
const [mergedProps, mergedRef] = useContextProps(
|
|
@@ -40,7 +56,12 @@ var AriaSelectValue = forwardRef(function AriaSelectValue2(props, ref) {
|
|
|
40
56
|
);
|
|
41
57
|
return /* @__PURE__ */ jsx(SelectValue, { ...mergedProps, ref: mergedRef });
|
|
42
58
|
});
|
|
59
|
+
var AriaTextContext = createContext(null);
|
|
60
|
+
var AriaText = forwardRef(function AriaText2(props, ref) {
|
|
61
|
+
const [mergedProps, mergedRef] = useContextProps(props, ref, AriaTextContext);
|
|
62
|
+
return /* @__PURE__ */ jsx(Text, { ...mergedProps, ref: mergedRef });
|
|
63
|
+
});
|
|
43
64
|
|
|
44
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext };
|
|
65
|
+
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaListBoxSection, AriaListBoxSectionContext, AriaMenuSection, AriaMenuSectionContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext };
|
|
45
66
|
//# sourceMappingURL=index.js.map
|
|
46
67
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/aria/index.tsx"],"names":["AriaSection","AriaSelectValue"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/aria/index.tsx"],"names":["AriaMenuSection","AriaListBoxSection","AriaSection","AriaSelectValue","AriaText"],"mappings":";;;;;AA+CA,SAAS,KACP,SAAA,EACA;AACA,EAAA,MAAM,OAAA,GAAU,cAAkC,IAAI,CAAA;AAEtD,EAAA,OAAO;AAAA,IACL,SAAA,EAAW,UAAA,CAAiB,SAAS,gBAAA,CAAiB,OAAO,GAAA,EAAK;AAChE,MAAA,MAAM,CAAC,WAAA,EAAa,SAAS,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,OAAO,CAAA;AAEpE,MAAA,uBAAO,GAAA,CAAC,SAAA,EAAA,EAAW,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AAAA,IACrD,CAAC,CAAA;AAAA,IACD;AAAA,GACF;AACF;AAEO,IAAM,EAAE,SAAA,EAAW,cAAA,EAAgB,SAAS,qBAAA,EAAsB,GACvE,KAAK,UAAU;AAEV,IAAM,EAAE,SAAA,EAAW,SAAA,EAAW,SAAS,gBAAA,EAAiB,GAAI,KAAK,KAAK;AAEtE,IAAM,EAAE,SAAA,EAAW,UAAA,EAAY,SAAS,iBAAA,EAAkB,GAC/D,KAAK,MAAM;AAEN,IAAM,EAAE,SAAA,EAAW,WAAA,EAAa,SAAS,kBAAA,EAAmB,GACjE,K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AAK,SAAA,EAAW,CAAA;AACnD,CAAC;AAEM,IAAM,sBAAA,GACX,cAAuE,IAAI;AAEtE,IAAM,eAAA,GAAkB,UAAA,CAAW,SAASC,gBAAAA,CAEjD,OAA4B,GAAA,EAAoC;AAChE,EAAA,MAAM,CAAC,WAAA,EAAa,SAAS,CAAA,GAAI,eAAA;AAAA,IAC/B,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBAAO,GAAA,CAAC,WAAA,EAAA,EAAa,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AACvD,CAAC;AAEM,IAAM,eAAA,GACX,cAAoD,IAAI;AAEnD,IAAM,QAAA,GAAW,UAAA,CAAW,SAASC,SAAAA,CAC1C,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,WAAA,EAAa,SAAS,IAAI,eAAA,CAAgB,KAAA,EAAO,KAAK,eAAe,CAAA;AAE5E,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,WAAA,EAAa,KAAK,SAAA,EAAW,CAAA;AAChD,CAAC","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\nimport {\n type ForwardedRef,\n type ReactNode,\n type RefAttributes,\n createContext,\n forwardRef,\n} from 'react';\nimport {\n type ContextValue,\n FieldError,\n Group,\n Header,\n Heading,\n Keyboard,\n Label,\n ListBoxSection,\n type ListBoxSectionProps,\n MenuSection,\n type MenuSectionProps,\n Section,\n type SectionProps,\n SelectValue,\n type SelectValueProps,\n Separator,\n Text,\n type TextProps,\n useContextProps,\n} from 'react-aria-components';\n\n/**\n * To better align with the guidance from RAC about establishing a unique\n * context for components to avoid conflict of props being provided by RAC\n * and design system components, this wrapping utility accepts an RAC and returns\n * a wrapped version along with the new context for the design system to use\n */\nfunction wrap<P extends object, E extends HTMLElement>(\n Component: (props: P & RefAttributes<E>) => ReactNode,\n) {\n const Context = createContext<ContextValue<P, E>>(null);\n\n return {\n Component: forwardRef<E, P>(function WrappedComponent(props, ref) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, Context);\n\n return <Component {...mergedProps} ref={mergedRef} />;\n }),\n Context,\n };\n}\n\nexport const { Component: AriaFieldError, Context: AriaFieldErrorContext } =\n wrap(FieldError);\n\nexport const { Component: AriaGroup, Context: AriaGroupContext } = wrap(Group);\n\nexport const { Component: AriaHeader, Context: AriaHeaderContext } =\n wrap(Header);\n\nexport const { Component: AriaHeading, Context: AriaHeadingContext } =\n wrap(Heading);\n\nexport const { Component: AriaKeyboard, Context: AriaKeyboardContext } =\n wrap(Keyboard);\n\nexport const { Component: AriaLabel, Context: AriaLabelContext } = wrap(Label);\n\nexport const { Component: AriaSeparator, Context: AriaSeparatorContext } =\n wrap(Separator);\n\n/**\n * Due to the complexity of types and technical constraints of TS, it's not\n * possible for the above wrapping utility to support components that accept\n * generic parameters. This means that these components must be manually wrapped\n */\n\nexport const AriaMenuSectionContext =\n createContext<ContextValue<MenuSectionProps<object>, HTMLElement>>(null);\n\nexport const AriaMenuSection = forwardRef(function AriaMenuSection<\n T extends object,\n>(props: MenuSectionProps<T>, ref: ForwardedRef<HTMLElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaMenuSectionContext,\n );\n\n return <MenuSection {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaListBoxSectionContext =\n createContext<ContextValue<ListBoxSectionProps<object>, HTMLElement>>(null);\n\nexport const AriaListBoxSection = forwardRef(function AriaListBoxSection<\n T extends object,\n>(props: ListBoxSectionProps<T>, ref: ForwardedRef<HTMLElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaListBoxSectionContext,\n );\n\n return <ListBoxSection {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaSectionContext =\n createContext<ContextValue<SectionProps<object>, HTMLElement>>(null);\n\nexport const AriaSection = forwardRef(function AriaSection<T extends object>(\n props: SectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaSectionContext,\n );\n\n return <Section {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaSelectValueContext =\n createContext<ContextValue<SelectValueProps<object>, HTMLSpanElement>>(null);\n\nexport const AriaSelectValue = forwardRef(function AriaSelectValue<\n T extends object,\n>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n const [mergedProps, mergedRef] = useContextProps(\n props,\n ref,\n AriaSelectValueContext,\n );\n\n return <SelectValue {...mergedProps} ref={mergedRef} />;\n});\n\nexport const AriaTextContext =\n createContext<ContextValue<TextProps, HTMLElement>>(null);\n\nexport const AriaText = forwardRef(function AriaText(\n props: TextProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, AriaTextContext);\n\n return <Text {...mergedProps} ref={mergedRef} />;\n});\n"]}
|
|
@@ -90,8 +90,8 @@ function useButton(props, ref, context, key) {
|
|
|
90
90
|
className: classNames?.container,
|
|
91
91
|
style
|
|
92
92
|
}),
|
|
93
|
-
// TODO(
|
|
94
|
-
//
|
|
93
|
+
// TODO(ilk): This should be checked. "rest changes on every re-render and should not be used as a hook dependency."
|
|
94
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: This should be checked and verified.
|
|
95
95
|
[rest, contextRef, children, classNames?.container, style]
|
|
96
96
|
);
|
|
97
97
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["Button","RACButton","LinkButton","ToggleButton","R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A,GAC3C;AAEA,EAAA,OAAO,OAAA;AAAA,IACL,OAAO;AAAA,MACL,GAAG,IAAA;AAAA,MACH,GAAA,EAAK,UAAA;AAAA,MACL,QAAA;AAAA,MACA,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB;AAAA,KACF,CAAA;AAAA;AAAA;AAAA,IAGA,CAAC,IAAA,EAAM,UAAA,EAAY,QAAA,EAAU,UAAA,EAAY,WAAW,KAAK;AAAA,GAC3D;AACF;AAEO,IAAM,aAAA,GACX,cAA4D,IAAI;AAE3D,IAAM,MAAA,GAAS,UAAA,CAAW,SAASA,OAAAA,CACxC,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA,CAAU,KAAA,EAAO,GAAA,EAAK,eAAe,QAAQ,CAAA;AAEjE,EAAA,uBAAO,GAAA,CAACC,QAAA,EAAA,EAAW,GAAG,WAAA,EAAa,CAAA;AACrC,CAAC;AAEM,IAAM,iBAAA,GACX,cAAgE,IAAI;AAE/D,IAAM,UAAA,GAAa,UAAA,CAAW,SAASC,WAAAA,CAC5C,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA,CAAU,KAAA,EAAO,GAAA,EAAK,mBAAmB,YAAY,CAAA;AAEzE,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,WAAA,EAAa,CAAA;AAChC,CAAC;AAEM,IAAM,mBAAA,GACX,cAAkE,IAAI;AAEjE,IAAM,YAAA,GAAe,UAAA,CAAW,SAASC,aAAAA,CAC9C,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA;AAAA,IAClB,KAAA;AAAA,IACA,GAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBAAO,GAAA,CAACC,cAAA,EAAA,EAAiB,GAAG,WAAA,EAAa,CAAA;AAC3C,CAAC","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\nimport { noop } from '@accelint/core';\nimport { clsx } from 'clsx';\nimport {\n type Context,\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ButtonRenderProps,\n type ContextValue,\n Link,\n type LinkRenderProps,\n Provider,\n Button as RACButton,\n ToggleButton as RACToggleButton,\n type ToggleButtonRenderProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { surfaces } from '../../styles/surfaces.css';\nimport { bodies } from '../../styles/typography.css';\nimport type { OmitProtectedProps } from '../../types/props';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { buttonClassNames, buttonStateVars } from './button.css';\nimport type {\n ButtonMapping,\n ButtonProps,\n ButtonSizes,\n LinkButtonProps,\n ToggleButtonProps,\n} from './types';\n\nconst noopToggleState = {\n defaultSelected: false,\n isSelected: false,\n setSelected: noop,\n toggle: noop,\n};\nconst buttonSizes: ButtonSizes[] = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst defaultMapping: ButtonMapping = {\n font: bodies,\n icon: buttonSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<ButtonSizes, OmitProtectedProps<IconProps>>,\n ),\n};\n\nfunction useButton<\n P extends ButtonProps | LinkButtonProps | ToggleButtonProps,\n E extends HTMLElement,\n>(\n props: P,\n ref: ForwardedRef<E>,\n context: Context<ContextValue<P, E>>,\n key: 'Button' | 'LinkButton' | 'ToggleButton',\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, context);\n\n const defaultedProps = useDefaultProps(contextProps, key);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n color = 'primary',\n mapping: mappingProp,\n size = 'md',\n variant = 'solid',\n ...rest\n } = defaultedProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(buttonClassNames, theme.Button, classNamesProp, {\n button: clsx(\n mapping.font[size],\n variant === 'floating' && surfaces.default.proud,\n ),\n }),\n [theme.Button, classNamesProp, mapping.font, size, variant],\n );\n\n const style = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) =>\n inlineVars(buttonStateVars, {\n isCurrent: false,\n isSelected: false,\n ...renderProps,\n color,\n size,\n variant,\n }),\n [color, size, variant],\n );\n\n const values = useMemo<\n [[typeof IconContext, ContextValue<IconProps, HTMLDivElement>]]\n >(() => [[IconContext, mapping.icon[size]]], [mapping.icon, size]);\n\n const children = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) => (\n <Provider values={values}>\n <span className={classNames?.button}>\n {callRenderProps(childrenProp, {\n state: noopToggleState,\n isCurrent: false,\n isPending: false,\n isSelected: false,\n ...renderProps,\n })}\n </span>\n </Provider>\n ),\n [values, classNames?.button, childrenProp],\n );\n\n return useMemo(\n () => ({\n ...rest,\n ref: contextRef,\n children,\n className: classNames?.container,\n style,\n }),\n // TODO(
|
|
1
|
+
{"version":3,"sources":["../../../src/components/button/index.tsx"],"names":["Button","RACButton","LinkButton","ToggleButton","RACToggleButton"],"mappings":";;;;;;;;;;;;;;;;AAmDA,IAAM,eAAA,GAAkB;AAAA,EACtB,eAAA,EAAiB,KAAA;AAAA,EACjB,UAA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MACL,QAAA;AAAA,MACA,WAAW,UAAA,EAAY,SAAA;AAAA,MACvB;AAAA,KACF,CAAA;AAAA;AAAA;AAAA,IAGA,CAAC,IAAA,EAAM,UAAA,EAAY,QAAA,EAAU,UAAA,EAAY,WAAW,KAAK;AAAA,GAC3D;AACF;AAEO,IAAM,aAAA,GACX,cAA4D,IAAI;AAE3D,IAAM,MAAA,GAAS,UAAA,CAAW,SAASA,OAAAA,CACxC,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA,CAAU,KAAA,EAAO,GAAA,EAAK,eAAe,QAAQ,CAAA;AAEjE,EAAA,uBAAO,GAAA,CAACC,QAAA,EAAA,EAAW,GAAG,WAAA,EAAa,CAAA;AACrC,CAAC;AAEM,IAAM,iBAAA,GACX,cAAgE,IAAI;AAE/D,IAAM,UAAA,GAAa,UAAA,CAAW,SAASC,WAAAA,CAC5C,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA,CAAU,KAAA,EAAO,GAAA,EAAK,mBAAmB,YAAY,CAAA;AAEzE,EAAA,uBAAO,GAAA,CAAC,IAAA,EAAA,EAAM,GAAG,WAAA,EAAa,CAAA;AAChC,CAAC;AAEM,IAAM,mBAAA,GACX,cAAkE,IAAI;AAEjE,IAAM,YAAA,GAAe,UAAA,CAAW,SAASC,aAAAA,CAC9C,OACA,GAAA,EACA;AACA,EAAA,MAAM,WAAA,GAAc,SAAA;AAAA,IAClB,KAAA;AAAA,IACA,GAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,uBAAO,GAAA,CAACC,cAAA,EAAA,EAAiB,GAAG,WAAA,EAAa,CAAA;AAC3C,CAAC","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\nimport { noop } from '@accelint/core';\nimport { clsx } from 'clsx';\nimport {\n type Context,\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ButtonRenderProps,\n type ContextValue,\n Link,\n type LinkRenderProps,\n Provider,\n Button as RACButton,\n ToggleButton as RACToggleButton,\n type ToggleButtonRenderProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { surfaces } from '../../styles/surfaces.css';\nimport { bodies } from '../../styles/typography.css';\nimport type { OmitProtectedProps } from '../../types/props';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { buttonClassNames, buttonStateVars } from './button.css';\nimport type {\n ButtonMapping,\n ButtonProps,\n ButtonSizes,\n LinkButtonProps,\n ToggleButtonProps,\n} from './types';\n\nconst noopToggleState = {\n defaultSelected: false,\n isSelected: false,\n setSelected: noop,\n toggle: noop,\n};\nconst buttonSizes: ButtonSizes[] = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst defaultMapping: ButtonMapping = {\n font: bodies,\n icon: buttonSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<ButtonSizes, OmitProtectedProps<IconProps>>,\n ),\n};\n\nfunction useButton<\n P extends ButtonProps | LinkButtonProps | ToggleButtonProps,\n E extends HTMLElement,\n>(\n props: P,\n ref: ForwardedRef<E>,\n context: Context<ContextValue<P, E>>,\n key: 'Button' | 'LinkButton' | 'ToggleButton',\n) {\n const [contextProps, contextRef] = useContextProps(props, ref, context);\n\n const defaultedProps = useDefaultProps(contextProps, key);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n color = 'primary',\n mapping: mappingProp,\n size = 'md',\n variant = 'solid',\n ...rest\n } = defaultedProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(buttonClassNames, theme.Button, classNamesProp, {\n button: clsx(\n mapping.font[size],\n variant === 'floating' && surfaces.default.proud,\n ),\n }),\n [theme.Button, classNamesProp, mapping.font, size, variant],\n );\n\n const style = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) =>\n inlineVars(buttonStateVars, {\n isCurrent: false,\n isSelected: false,\n ...renderProps,\n color,\n size,\n variant,\n }),\n [color, size, variant],\n );\n\n const values = useMemo<\n [[typeof IconContext, ContextValue<IconProps, HTMLDivElement>]]\n >(() => [[IconContext, mapping.icon[size]]], [mapping.icon, size]);\n\n const children = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) => (\n <Provider values={values}>\n <span className={classNames?.button}>\n {callRenderProps(childrenProp, {\n state: noopToggleState,\n isCurrent: false,\n isPending: false,\n isSelected: false,\n ...renderProps,\n })}\n </span>\n </Provider>\n ),\n [values, classNames?.button, childrenProp],\n );\n\n return useMemo(\n () => ({\n ...rest,\n ref: contextRef,\n children,\n className: classNames?.container,\n style,\n }),\n // TODO(ilk): This should be checked. \"rest changes on every re-render and should not be used as a hook dependency.\"\n // biome-ignore lint/correctness/useExhaustiveDependencies: This should be checked and verified.\n [rest, contextRef, children, classNames?.container, style],\n );\n}\n\nexport const ButtonContext =\n createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nexport const Button = forwardRef(function Button(\n props: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const buttonProps = useButton(props, ref, ButtonContext, 'Button');\n\n return <RACButton {...buttonProps} />;\n});\n\nexport const LinkButtonContext =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nexport const LinkButton = forwardRef(function LinkButton(\n props: LinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n const buttonProps = useButton(props, ref, LinkButtonContext, 'LinkButton');\n\n return <Link {...buttonProps} />;\n});\n\nexport const ToggleButtonContext =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nexport const ToggleButton = forwardRef(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const buttonProps = useButton(\n props,\n ref,\n ToggleButtonContext,\n 'ToggleButton',\n );\n\n return <RACToggleButton {...buttonProps} />;\n});\n"]}
|
|
@@ -6,13 +6,11 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
6
6
|
|
|
7
7
|
function createCollectionRenderer(context, values) {
|
|
8
8
|
return {
|
|
9
|
-
// biome-ignore lint/style/useNamingConvention: intentional
|
|
10
9
|
CollectionRoot: ({ renderDropIndicator }) => /* @__PURE__ */ jsx(MergeProvider, { values, children: useCollectionRender(
|
|
11
10
|
useContext(context)?.collection,
|
|
12
11
|
null,
|
|
13
12
|
renderDropIndicator
|
|
14
13
|
) }),
|
|
15
|
-
// biome-ignore lint/style/useNamingConvention: intentional
|
|
16
14
|
CollectionBranch: ({ collection, parent, renderDropIndicator }) => /* @__PURE__ */ jsx(MergeProvider, { values, children: useCollectionRender(collection, parent, renderDropIndicator) })
|
|
17
15
|
};
|
|
18
16
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/collection/index.tsx"],"names":[],"mappings":";;;;;;AAyBO,SAAS,wBAAA,CAGd,SAAqB,MAAA,EAA+B;AACpD,EAAA,OAAO;AAAA
|
|
1
|
+
{"version":3,"sources":["../../../src/components/collection/index.tsx"],"names":[],"mappings":";;;;;;AAyBO,SAAS,wBAAA,CAGd,SAAqB,MAAA,EAA+B;AACpD,EAAA,OAAO;AAAA,IACL,gBAAgB,CAAC,EAAE,qBAAoB,qBACrC,GAAA,CAAC,iBAAc,MAAA,EACZ,QAAA,EAAA,mBAAA;AAAA,MACC,UAAA,CAAW,OAAO,CAAA,EAAG,UAAA;AAAA,MACrB,IAAA;AAAA,MACA;AAAA,KACF,EACF,CAAA;AAAA,IAEF,gBAAA,EAAkB,CAAC,EAAE,UAAA,EAAY,QAAQ,mBAAA,EAAoB,qBAC3D,GAAA,CAAC,aAAA,EAAA,EAAc,MAAA,EACZ,QAAA,EAAA,mBAAA,CAAoB,UAAA,EAAY,MAAA,EAAQ,mBAAmB,CAAA,EAC9D;AAAA,GAEJ;AACF","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\nimport type { Collection, Node } from '@react-types/shared';\nimport { type Context, useContext } from 'react';\nimport type { CollectionRenderer } from 'react-aria-components';\nimport { useCollectionRender } from '../../hooks/use-collection-render';\nimport { MergeProvider } from '../merge-provider';\nimport type { MergeProviderProps } from '../merge-provider/types';\n\n/**\n * Replace the default collection renderer to allow for injection of\n * context props for multiple composed components. Also enables use of\n * Section as wrapper of list items at the top level as a styleable\n * element within the RAC container\n */\nexport function createCollectionRenderer<\n C extends { readonly collection: Collection<Node<unknown>> },\n V extends MergeProviderProps['values'],\n>(context: Context<C>, values: V): CollectionRenderer {\n return {\n CollectionRoot: ({ renderDropIndicator }) => (\n <MergeProvider values={values}>\n {useCollectionRender(\n useContext(context)?.collection,\n null,\n renderDropIndicator,\n )}\n </MergeProvider>\n ),\n CollectionBranch: ({ collection, parent, renderDropIndicator }) => (\n <MergeProvider values={values}>\n {useCollectionRender(collection, parent, renderDropIndicator)}\n </MergeProvider>\n ),\n };\n}\n"]}
|
|
@@ -4,7 +4,7 @@ import { IconSizes, IconProps } from './types.js';
|
|
|
4
4
|
import * as react from 'react';
|
|
5
5
|
|
|
6
6
|
declare const IconContext: react.Context<ContextValue<IconProps, HTMLDivElement>>;
|
|
7
|
-
declare const Icon: (props: Pick<react.CSSProperties, "
|
|
7
|
+
declare const Icon: (props: Pick<react.CSSProperties, "color" | "fill" | "stroke"> & {
|
|
8
8
|
classNames?: Partial<{
|
|
9
9
|
container: string;
|
|
10
10
|
icon: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext } from './aria/index.js';
|
|
1
|
+
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaListBoxSection, AriaListBoxSectionContext, AriaMenuSection, AriaMenuSectionContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext } from './aria/index.js';
|
|
2
2
|
export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext } from './button/index.js';
|
|
3
3
|
export { buttonClassNames, buttonColorVars, buttonContainer, buttonSpaceVars, buttonStateVars } from './button/button.css.js';
|
|
4
4
|
export { ButtonClassNames, ButtonColors, ButtonMapping, ButtonProps, ButtonRenderProps, ButtonSizes, ButtonState, ButtonVariants, LinkButtonProps, ToggleButtonProps } from './button/types.js';
|
|
@@ -75,12 +75,12 @@ export { SwitchAlignment, SwitchClassNames, SwitchProps, SwitchRenderProps, Swit
|
|
|
75
75
|
export { Tab, TabContext, TabList, TabListContext, TabPanel, TabPanelContext, TabPanels, TabPanelsContext, Tabs, TabsContext } from './tabs/index.js';
|
|
76
76
|
export { tabColorVars, tabListStateVars, tabPanelStateVars, tabPanelsStateVars, tabSpaceVars, tabStateVars, tabsClassNames, tabsContainers } from './tabs/tabs.css.js';
|
|
77
77
|
export { TabListAlignment, TabListAnchor, TabListProps, TabListState, TabListVariants, TabPanelProps, TabPanelRenderProps, TabPanelState, TabPanelsProps, TabPanelsState, TabProps, TabRenderProps, TabState, TabsClassNames, TabsProps } from './tabs/types.js';
|
|
78
|
-
export { TextArea, TextAreaContext } from './textarea/index.js';
|
|
79
|
-
export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './textarea/textarea.css.js';
|
|
80
|
-
export { TextAreaClassNames, TextAreaProps, TextAreaRenderProps, TextAreaState } from './textarea/types.js';
|
|
81
78
|
export { TextField, TextFieldContext } from './text-field/index.js';
|
|
82
79
|
export { textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldSpaceVars, textFieldStateVars } from './text-field/text-field.css.js';
|
|
83
80
|
export { TextFieldClassNames, TextFieldMapping, TextFieldProps, TextFieldSizes, TextFieldState } from './text-field/types.js';
|
|
81
|
+
export { TextArea, TextAreaContext } from './textarea/index.js';
|
|
82
|
+
export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './textarea/textarea.css.js';
|
|
83
|
+
export { TextAreaClassNames, TextAreaProps, TextAreaRenderProps, TextAreaState } from './textarea/types.js';
|
|
84
84
|
export { TimeField, TimeFieldContext } from './time-field/index.js';
|
|
85
85
|
export { timeFieldClassNames, timeFieldColorVars, timeFieldContainer, timeFieldSpaceVars, timeFieldStateVars } from './time-field/time-field.css.js';
|
|
86
86
|
export { TimeFieldClassNames, TimeFieldMapping, TimeFieldProps, TimeFieldRenderProps, TimeFieldSizes, TimeFieldState } from './time-field/types.js';
|
package/dist/components/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '../chunk-PZ5AY32C.js';
|
|
2
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext } from './aria/index.js';
|
|
2
|
+
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaListBoxSection, AriaListBoxSectionContext, AriaMenuSection, AriaMenuSectionContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext } from './aria/index.js';
|
|
3
3
|
export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext } from './button/index.js';
|
|
4
4
|
export { buttonClassNames, buttonColorVars, buttonContainer, buttonSpaceVars, buttonStateVars } from './button/button.css.js';
|
|
5
5
|
export { Checkbox, CheckboxContext, CheckboxGroup, CheckboxGroupContext } from './checkbox/index.js';
|
|
@@ -51,10 +51,10 @@ export { Switch, SwitchContext } from './switch/index.js';
|
|
|
51
51
|
export { switchClassNames, switchColorVars, switchContainer, switchSpaceVars, switchStateVars } from './switch/switch.css.js';
|
|
52
52
|
export { Tab, TabContext, TabList, TabListContext, TabPanel, TabPanelContext, TabPanels, TabPanelsContext, Tabs, TabsContext } from './tabs/index.js';
|
|
53
53
|
export { tabColorVars, tabListStateVars, tabPanelStateVars, tabPanelsStateVars, tabSpaceVars, tabStateVars, tabsClassNames, tabsContainers } from './tabs/tabs.css.js';
|
|
54
|
-
export { TextArea, TextAreaContext } from './textarea/index.js';
|
|
55
|
-
export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './textarea/textarea.css.js';
|
|
56
54
|
export { TextField, TextFieldContext } from './text-field/index.js';
|
|
57
55
|
export { textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldSpaceVars, textFieldStateVars } from './text-field/text-field.css.js';
|
|
56
|
+
export { TextArea, TextAreaContext } from './textarea/index.js';
|
|
57
|
+
export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './textarea/textarea.css.js';
|
|
58
58
|
export { TimeField, TimeFieldContext } from './time-field/index.js';
|
|
59
59
|
export { timeFieldClassNames, timeFieldColorVars, timeFieldContainer, timeFieldSpaceVars, timeFieldStateVars } from './time-field/time-field.css.js';
|
|
60
60
|
export { Tooltip, TooltipContext, TooltipTarget, TooltipTargetContext } from './tooltip/index.js';
|
|
@@ -8,7 +8,7 @@ import { useTheme } from '../../hooks/use-theme/index.js';
|
|
|
8
8
|
import { bodies, headings } from '../../styles/typography.css.js';
|
|
9
9
|
import { inlineVars } from '../../utils/css/index.js';
|
|
10
10
|
import { mergeClassNames, callRenderProps } from '../../utils/props/index.js';
|
|
11
|
-
import {
|
|
11
|
+
import { AriaMenuSectionContext, AriaHeaderContext, AriaSeparatorContext, AriaMenuSection, AriaTextContext, AriaKeyboardContext, AriaText } from '../aria/index.js';
|
|
12
12
|
import { createCollectionRenderer } from '../collection/index.js';
|
|
13
13
|
import { IconContext } from '../icon/index.js';
|
|
14
14
|
import { menuClassNames, menuStateVars, menuItemStateVars } from './menu.css.js';
|
|
@@ -125,7 +125,7 @@ var MenuList = forwardRef(function MenuList2(props, ref) {
|
|
|
125
125
|
const values = useMemo(
|
|
126
126
|
() => [
|
|
127
127
|
[MenuItemContext, { classNames, mapping, size }],
|
|
128
|
-
[
|
|
128
|
+
[AriaMenuSectionContext, { className: classNames?.list?.section }],
|
|
129
129
|
[AriaHeaderContext, { className: classNames?.list?.header }],
|
|
130
130
|
[AriaSeparatorContext, { className: classNames?.list?.separator }]
|
|
131
131
|
],
|
|
@@ -135,7 +135,7 @@ var MenuList = forwardRef(function MenuList2(props, ref) {
|
|
|
135
135
|
if (!(childrenProp || items)) {
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
|
-
return /* @__PURE__ */ jsx(
|
|
138
|
+
return /* @__PURE__ */ jsx(AriaMenuSection, { className: classNames?.list?.list, children: typeof childrenProp === "function" ? /* @__PURE__ */ jsx(Collection, { items, children: childrenProp }) : childrenProp });
|
|
139
139
|
}, [childrenProp, classNames?.list?.list, items]);
|
|
140
140
|
const renderer = useMemo(
|
|
141
141
|
// @ts-expect-error ts unnecessarily guarding against null state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["Menu","MenuList","RACMenu","MenuItem","RACMenuItem"],"mappings":";;;;;;;;;;;;;;;;AAiEA,IAAM,cAAA,GAA8B;AAAA,EAClC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAI,QAAA,CAAS,EAAA;AAAA,IACb,IAAI,QAAA,CAAS;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA;AAEf,CAAA;AAEA,IAAM,WAAA,GAAc,IAAA;AAEb,IAAM,WAAA,GACX,cAAoD,IAAI;AAMnD,IAAM,IAAA,GAAO,UAAA,CAAW,SAASA,KAAAA,CACtC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,WAAA,EA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AAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","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\nimport {\n type ForwardedRef,\n type HTMLAttributes,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n DEFAULT_SLOT,\n MenuStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemRenderProps as RACMenuItemRenderProps,\n type SectionProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaSection,\n AriaSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { menuClassNames, menuItemStateVars, menuStateVars } from './menu.css';\nimport type {\n MenuItemProps,\n MenuListProps,\n MenuMapping,\n MenuProps,\n} from './types';\n\nconst defaultMapping: MenuMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps, HTMLElement>>(null);\n\n/**\n * Menu component that supports display and selection of menu items via a trigger (right-click or click)\n * Customization of React Aria's Menu and Menu Item components https://react-spectrum.adobe.com/react-aria/Menu.html\n */\nexport const Menu = forwardRef(function Menu(\n props: MenuProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n menu: { container: theme.className }, // required to consume global theme within Popover\n }),\n [classNamesProp, theme.Menu, theme.className],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n (renderProps: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(menuStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof MenuListContext,\n ContextValue<MenuListProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[MenuListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.menu?.menu}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.menu?.menu, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={mergedRef}\n className={classNames?.menu?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const MenuListContext =\n createContext<ContextValue<MenuListProps<unknown>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [\n typeof MenuItemContext,\n ContextValue<MenuItemProps<unknown>, HTMLDivElement>,\n ],\n [typeof AriaSectionContext, ContextValue<SectionProps<object>, HTMLElement>],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const MenuList = forwardRef(function MenuList<T extends object>(\n props: MenuListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuListContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, theme.Menu, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Menu, classNamesProp, mapping.header, size],\n );\n\n const values = useMemo<MenuListContexts>(\n () => [\n [MenuItemContext, { classNames, mapping, size }],\n [AriaSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaSection>\n );\n }, [childrenProp, classNames?.list?.list, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(MenuStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <RACMenu<T>\n {...rest}\n ref={mergedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </RACMenu>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const MenuItemContext =\n createContext<ContextValue<MenuItemProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuItem = forwardRef(function MenuItem<T extends object>(\n props: MenuItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuItemContext);\n const finalProps = useDefaultProps(mergedProps, 'MenuItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Menu, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: RACMenuItemRenderProps) =>\n inlineVars(menuItemStateVars, { ...renderProps, size, hasDescription }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: { classNames: classNames?.item?.icon },\n more: { classNames: classNames?.item?.more },\n },\n },\n ],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.more,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACMenuItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <RACMenuItem<T>\n {...rest}\n id={id ?? textValue}\n ref={mergedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </RACMenuItem>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["Menu","MenuList","RACMenu","MenuItem","RACMenuItem"],"mappings":";;;;;;;;;;;;;;;;AAiEA,IAAM,cAAA,GAA8B;AAAA,EAClC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAI,QAAA,CAAS,EAAA;AAAA,IACb,IAAI,QAAA,CAAS;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,QAAA,EAAU;AAAA,IACR,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAA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AA;AAAA,IAACC,UAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,GAAA,EAAK,SAAA;AAAA,MACL,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","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\nimport {\n type ForwardedRef,\n type HTMLAttributes,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n DEFAULT_SLOT,\n type MenuSectionProps,\n MenuStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n Menu as RACMenu,\n MenuItem as RACMenuItem,\n type MenuItemRenderProps as RACMenuItemRenderProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaMenuSection,\n AriaMenuSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport { menuClassNames, menuItemStateVars, menuStateVars } from './menu.css';\nimport type {\n MenuItemProps,\n MenuListProps,\n MenuMapping,\n MenuProps,\n} from './types';\n\nconst defaultMapping: MenuMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps, HTMLElement>>(null);\n\n/**\n * Menu component that supports display and selection of menu items via a trigger (right-click or click)\n * Customization of React Aria's Menu and Menu Item components https://react-spectrum.adobe.com/react-aria/Menu.html\n */\nexport const Menu = forwardRef(function Menu(\n props: MenuProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n menu: { container: theme.className }, // required to consume global theme within Popover\n }),\n [classNamesProp, theme.Menu, theme.className],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n (renderProps: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(menuStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof MenuListContext,\n ContextValue<MenuListProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[MenuListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.menu?.menu}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.menu?.menu, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={mergedRef}\n className={classNames?.menu?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const MenuListContext =\n createContext<ContextValue<MenuListProps<unknown>, HTMLDivElement>>(null);\n\ntype MenuListContexts = [\n [\n typeof MenuItemContext,\n ContextValue<MenuItemProps<unknown>, HTMLDivElement>,\n ],\n [\n typeof AriaMenuSectionContext,\n ContextValue<MenuSectionProps<object>, HTMLElement>,\n ],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const MenuList = forwardRef(function MenuList<T extends object>(\n props: MenuListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuListContext);\n const finalProps = useDefaultProps(mergedProps, 'Menu');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, theme.Menu, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Menu, classNamesProp, mapping.header, size],\n );\n\n const values = useMemo<MenuListContexts>(\n () => [\n [MenuItemContext, { classNames, mapping, size }],\n [AriaMenuSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, mapping, size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaMenuSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaMenuSection>\n );\n }, [childrenProp, classNames?.list?.list, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(MenuStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <RACMenu<T>\n {...rest}\n ref={mergedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </RACMenu>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const MenuItemContext =\n createContext<ContextValue<MenuItemProps<unknown>, HTMLDivElement>>(null);\n\nexport const MenuItem = forwardRef(function MenuItem<T extends object>(\n props: MenuItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [mergedProps, mergedRef] = useContextProps(props, ref, MenuItemContext);\n const finalProps = useDefaultProps(mergedProps, 'MenuItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(menuClassNames, classNamesProp, theme.Menu, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Menu, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: RACMenuItemRenderProps) =>\n inlineVars(menuItemStateVars, { ...renderProps, size, hasDescription }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n [DEFAULT_SLOT]: {},\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: { classNames: classNames?.item?.icon },\n more: { classNames: classNames?.item?.more },\n },\n },\n ],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.more,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: RACMenuItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <RACMenuItem<T>\n {...rest}\n id={id ?? textValue}\n ref={mergedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </RACMenuItem>\n );\n});\n"]}
|
|
@@ -8,7 +8,7 @@ import { useTheme } from '../../hooks/use-theme/index.js';
|
|
|
8
8
|
import { bodies, headings } from '../../styles/typography.css.js';
|
|
9
9
|
import { inlineVars } from '../../utils/css/index.js';
|
|
10
10
|
import { mergeClassNames, callRenderProps } from '../../utils/props/index.js';
|
|
11
|
-
import {
|
|
11
|
+
import { AriaListBoxSectionContext, AriaHeaderContext, AriaSeparatorContext, AriaListBoxSection, AriaTextContext, AriaKeyboardContext, AriaText } from '../aria/index.js';
|
|
12
12
|
import { createCollectionRenderer } from '../collection/index.js';
|
|
13
13
|
import { IconContext } from '../icon/index.js';
|
|
14
14
|
import { optionsClassNames, optionsStateVars, optionsItemStateVars } from './options.css.js';
|
|
@@ -135,7 +135,7 @@ var OptionsList = forwardRef(function OptionList(props, ref) {
|
|
|
135
135
|
const values = useMemo(
|
|
136
136
|
() => [
|
|
137
137
|
[OptionsItemContext, { classNames, size, mapping }],
|
|
138
|
-
[
|
|
138
|
+
[AriaListBoxSectionContext, { className: classNames?.list?.section }],
|
|
139
139
|
[AriaHeaderContext, { className: classNames?.list?.header }],
|
|
140
140
|
[AriaSeparatorContext, { className: classNames?.list?.separator }]
|
|
141
141
|
],
|
|
@@ -149,7 +149,7 @@ var OptionsList = forwardRef(function OptionList(props, ref) {
|
|
|
149
149
|
if (!(childrenProp || items)) {
|
|
150
150
|
return null;
|
|
151
151
|
}
|
|
152
|
-
return /* @__PURE__ */ jsx(
|
|
152
|
+
return /* @__PURE__ */ jsx(AriaListBoxSection, { className: classNames?.list?.list, children: typeof childrenProp === "function" ? /* @__PURE__ */ jsx(Collection, { items, children: childrenProp }) : childrenProp });
|
|
153
153
|
}, [classNames?.list?.list, childrenProp, items]);
|
|
154
154
|
const renderer = useMemo(
|
|
155
155
|
// @ts-expect-error ts unnecessarily guarding against null state
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["Options"],"mappings":";;;;;;;;;;;;;;;;AAqEA,IAAM,cAAA,GAAiC;AAAA,EACrC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,IAAI,QAAA,CAAS,EAAA;AAAA,IACb,IAAI,QAAA,CAAS;AAAA,GACf;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAA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AA,GAEhC,SAEJ,CAAA,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,MAAM,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,GAAA,EAAK,WAAA;AAAA,MACL,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","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\nimport {\n type ForwardedRef,\n type HTMLAttributes,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n type SectionProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaSection,\n AriaSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport {\n optionsClassNames,\n optionsItemStateVars,\n optionsStateVars,\n} from './options.css';\nimport type {\n OptionsItemProps,\n OptionsListProps,\n OptionsMapping,\n OptionsProps,\n} from './types';\n\nconst defaultMapping: OptionsMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const OptionsContext =\n createContext<ContextValue<OptionsProps, HTMLElement>>(null);\n\nexport const Options = forwardRef(function Options(\n props: OptionsProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'Options');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, theme.Options, classNamesProp, {\n options: {\n container: theme.className, // required to consume global theme within Popover\n },\n }),\n [theme.className, theme.Options, classNamesProp],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n ({ ...renderProps }: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(optionsStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof OptionsListContext,\n ContextValue<OptionsListProps<object>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[OptionsListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.options?.options}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.options?.options, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={resolvedRef}\n className={classNames?.options?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const OptionsListContext =\n createContext<ContextValue<OptionsListProps<object>, HTMLDivElement>>(null);\n\ntype OptionsListContexts = [\n [\n typeof OptionsItemContext,\n ContextValue<OptionsItemProps<object>, HTMLDivElement>,\n ],\n [typeof AriaSectionContext, ContextValue<SectionProps<object>, HTMLElement>],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const OptionsList = forwardRef(function OptionList<T extends object>(\n props: OptionsListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsListContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsList');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, theme.Options, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const values = useMemo<OptionsListContexts>(\n () => [\n [OptionsItemContext, { classNames, size, mapping }],\n [AriaSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, size, mapping],\n );\n\n const style = useCallback(\n (renderProps: ListBoxRenderProps) =>\n inlineVars(optionsItemStateVars, { ...renderProps, size }),\n [size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaSection>\n );\n }, [classNames?.list?.list, childrenProp, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(ListStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const OptionsItemContext =\n createContext<ContextValue<OptionsItemProps<object>, HTMLDivElement>>(null);\n\nexport const OptionsItem = forwardRef(function OptionItem<T extends object>(\n props: OptionsItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsItemContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, classNamesProp, theme.Options, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(optionsItemStateVars, {\n ...renderProps,\n size,\n hasDescription,\n }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [IconContext, { classNames: classNames?.item?.icon }],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n id={id ?? textValue}\n ref={resolvedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["Options"],"mappings":";;;;;;;;;;;;;;;;AAqEA,IAAM,cAAA,GAAiC;AAAA,EACrC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAA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,8BAAC,KAAA,EAAA,EAAI,SAAA,EAAW,YAAY,IAAA,EAAM,IAAA,EAC/B,iBAAO,OAAA,KAAY,QAAA,uBACjB,QAAA,EAAA,EAAS,IAAA,EAAK,SAAS,QAAA,EAAA,OAAA,EAAQ,CAAA,GAEhC,SAEJ,CAAA,EACF,CAAA;AAAA,IAEJ,CAAA;AAAA,IACA,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAA,EAAM,MAAM,MAAM;AAAA,GACrD;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,GAAA,EAAK,WAAA;AAAA,MACL,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","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\nimport {\n type ForwardedRef,\n type HTMLAttributes,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type CollectionRenderer,\n CollectionRendererContext,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListStateContext,\n Popover,\n type PopoverRenderProps,\n Provider,\n type SectionProps,\n type SeparatorProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useSlot } from '../../hooks/use-slot';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies, headings } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaHeaderContext,\n AriaKeyboardContext,\n AriaListBoxSection,\n AriaListBoxSectionContext,\n AriaSeparatorContext,\n AriaText,\n AriaTextContext,\n} from '../aria';\nimport { createCollectionRenderer } from '../collection';\nimport { IconContext } from '../icon';\nimport type { IconProps } from '../icon/types';\nimport {\n optionsClassNames,\n optionsItemStateVars,\n optionsStateVars,\n} from './options.css';\nimport type {\n OptionsItemProps,\n OptionsListProps,\n OptionsMapping,\n OptionsProps,\n} from './types';\n\nconst defaultMapping: OptionsMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n header: {\n sm: headings.v4,\n lg: headings.v5,\n },\n label: {\n sm: bodies.sm,\n lg: bodies.sm,\n },\n shortcut: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n};\n\nconst defaultSize = 'lg';\n\nexport const OptionsContext =\n createContext<ContextValue<OptionsProps, HTMLElement>>(null);\n\nexport const Options = forwardRef(function Options(\n props: OptionsProps,\n ref: ForwardedRef<HTMLElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'Options');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, theme.Options, classNamesProp, {\n options: {\n container: theme.className, // required to consume global theme within Popover\n },\n }),\n [theme.className, theme.Options, classNamesProp],\n );\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const style = useCallback(\n ({ ...renderProps }: PopoverRenderProps) => ({\n ...theme.style, // required to consume global styles within Popover\n ...inlineVars(optionsStateVars, {\n ...renderProps,\n size,\n }),\n }),\n [theme.style, size],\n );\n\n const values = useMemo<\n [\n [\n typeof OptionsListContext,\n ContextValue<OptionsListProps<object>, HTMLDivElement>,\n ],\n ]\n >(\n () => [[OptionsListContext, { classNames, mapping, size }]],\n [classNames, mapping, size],\n );\n\n const children = useCallback(\n (renderProps: PopoverRenderProps) => (\n <Provider values={values}>\n <div className={classNames?.options?.options}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n })}\n </div>\n </Provider>\n ),\n [childrenProp, classNames?.options?.options, size, values],\n );\n\n return (\n <Popover\n {...rest}\n ref={resolvedRef}\n className={classNames?.options?.container}\n style={style}\n >\n {children}\n </Popover>\n );\n});\n\nexport const OptionsListContext =\n createContext<ContextValue<OptionsListProps<object>, HTMLDivElement>>(null);\n\ntype OptionsListContexts = [\n [\n typeof OptionsItemContext,\n ContextValue<OptionsItemProps<object>, HTMLDivElement>,\n ],\n [\n typeof AriaListBoxSectionContext,\n ContextValue<SectionProps<object>, HTMLElement>,\n ],\n [\n typeof AriaHeaderContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n [typeof AriaSeparatorContext, ContextValue<SeparatorProps, HTMLElement>],\n];\n\nexport const OptionsList = forwardRef(function OptionList<T extends object>(\n props: OptionsListProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsListContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsList');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n items,\n mapping: mappingProp,\n selectionMode = 'single',\n size = defaultSize,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, theme.Options, classNamesProp, {\n list: { header: mapping.header[size] },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const values = useMemo<OptionsListContexts>(\n () => [\n [OptionsItemContext, { classNames, size, mapping }],\n [AriaListBoxSectionContext, { className: classNames?.list?.section }],\n [AriaHeaderContext, { className: classNames?.list?.header }],\n [AriaSeparatorContext, { className: classNames?.list?.separator }],\n ],\n [classNames, size, mapping],\n );\n\n const style = useCallback(\n (renderProps: ListBoxRenderProps) =>\n inlineVars(optionsItemStateVars, { ...renderProps, size }),\n [size],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <AriaListBoxSection className={classNames?.list?.list}>\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </AriaListBoxSection>\n );\n }, [classNames?.list?.list, childrenProp, items]);\n\n const renderer = useMemo<CollectionRenderer>(\n // @ts-expect-error ts unnecessarily guarding against null state\n () => createCollectionRenderer(ListStateContext, values),\n [values],\n );\n\n return (\n <CollectionRendererContext.Provider value={renderer}>\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n </CollectionRendererContext.Provider>\n );\n});\n\nexport const OptionsItemContext =\n createContext<ContextValue<OptionsItemProps<object>, HTMLDivElement>>(null);\n\nexport const OptionsItem = forwardRef(function OptionItem<T extends object>(\n props: OptionsItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n OptionsItemContext,\n );\n const finalProps = useDefaultProps(resolvedProps, 'OptionsItem');\n\n const {\n id,\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = defaultSize,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(optionsClassNames, classNamesProp, theme.Options, {\n item: {\n description: mapping.description[size],\n label: mapping.label[size],\n shortcut: mapping.shortcut[size],\n },\n }),\n [theme.Options, classNamesProp, mapping, size],\n );\n\n const [descriptionRef, hasDescription] = useSlot();\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(optionsItemStateVars, {\n ...renderProps,\n size,\n hasDescription,\n }),\n [hasDescription, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [typeof IconContext, ContextValue<IconProps, HTMLDivElement>],\n [\n typeof AriaKeyboardContext,\n ContextValue<HTMLAttributes<HTMLElement>, HTMLElement>,\n ],\n ]\n >(\n () => [\n [\n AriaTextContext,\n {\n slots: {\n label: { className: classNames?.item?.label },\n description: {\n ref: descriptionRef,\n className: classNames?.item?.description,\n },\n },\n },\n ],\n [IconContext, { classNames: classNames?.item?.icon }],\n [AriaKeyboardContext, { className: classNames?.item?.shortcut }],\n ],\n [\n classNames?.item?.label,\n descriptionRef,\n classNames?.item?.description,\n classNames?.item?.icon,\n classNames?.item?.shortcut,\n ],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => {\n const content = callRenderProps(childrenProp, {\n ...renderProps,\n size,\n defaultChildren: null,\n });\n\n return (\n <Provider values={values}>\n <div className={classNames?.item?.item}>\n {typeof content === 'string' ? (\n <AriaText slot='label'>{content}</AriaText>\n ) : (\n content\n )}\n </div>\n </Provider>\n );\n },\n [childrenProp, classNames?.item?.item, size, values],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n id={id ?? textValue}\n ref={resolvedRef as unknown as Ref<T>}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import '../../chunk-PZ5AY32C.js';
|
|
2
2
|
import { createContext, forwardRef, useMemo, useCallback } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { ListBoxSection, Collection, Provider, ListBox, ListBoxItem } from 'react-aria-components';
|
|
4
4
|
import { useContextProps } from '../../hooks/use-context-props/index.js';
|
|
5
5
|
import { useDefaultProps } from '../../hooks/use-defaults/index.js';
|
|
6
6
|
import { useTheme } from '../../hooks/use-theme/index.js';
|
|
@@ -50,7 +50,7 @@ var Picker = forwardRef(function Picker2(props, ref) {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
return /* @__PURE__ */ jsx(
|
|
53
|
-
|
|
53
|
+
ListBoxSection,
|
|
54
54
|
{
|
|
55
55
|
className: classNames?.list?.list,
|
|
56
56
|
"aria-label": ariaLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/picker/index.tsx"],"names":["Picker","PickerItem"],"mappings":";;;;;;;;;;;AA0CO,IAAM,aAAA,GACX,cAAkE,IAAI;AAEjE,IAAM,iBAAA,GACX,cAAsE,IAAI;AAQrE,IAAM,MAAA,GAAS,UAAA,CAAW,SAASA,OAAAA,CACxC,OACA,GAAA,EACA;AACA,EAAA,MAAM,CAAC,aAAA,EAAe,WAAW,CAAA,GAAI,eAAA;AAAA,IACnC,KAAA;AAAA,IACA,GAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAA,MAAM,UAAA,GAAa,eAAA,CAAgB,aAAA,EAAe,QAAQ,CAAA;AAE1D,EAAA,MAAM;AAAA,IACJ,QAAA,EAAU,YAAA;AAAA,IACV,UAAA,EAAY,cAAA;AAAA,IACZ,OAAA;AAAA,IACA,KAAA;AAAA,IACA,MAAA,GAAS,OAAA;AAAA,IACT,WAAA,GAAc,YAAA;AAAA,IACd,aAAA,GAAgB,QAAA;AAAA,IAChB,YAAA,EAAc,SAAA;AAAA,IACd,i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AQ,cAAc;AAAA,GAC/B;AAEA,EAAA,MAAM,KAAA,GAAQ,WAAA;AAAA,IACZ,CAAC,WAAA,KACC,UAAA,CAAW,mBAAA,EAAqB,WAAW,CAAA;AAAA,IAC7C;AAAC,GACH;AAEA,EAAA,MAAM,QAAA,GAAW,WAAA;AAAA,IACf,CAAC,gCACC,GAAA,CAAC,KAAA,EAAA,EAAI,WAAW,UAAA,EAAY,IAAA,EAAM,IAAA,EAC/B,QAAA,EAAA,eAAA,CAAgB,YAAA,EAAc;AAAA,MAC7B,GAAG,WAAA;AAAA,MACH,eAAA,EAAiB;AAAA,KAClB,CAAA,EACH,CAAA;AAAA,IAEF,CAAC,YAAA,EAAc,UAAA,EAAY,IAAA,EAAM,IAAI;AAAA,GACvC;AAEA,EAAA,uBACE,GAAA;AAAA,IAAC,WAAA;AAAA,IAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA,EAAK,WAAA;AAAA,MACL,IAAI,EAAA,IAAM,SAAA;AAAA,MACV,SAAA,EAAW,YAAY,IAAA,EAAM,SAAA;AAAA,MAC7B,KAAA;AAAA,MACA,SAAA;AAAA,MAEC;AAAA;AAAA,GACH;AAEJ,CAAC","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\nimport {\n type ForwardedRef,\n type Ref,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n Collection,\n type ContextValue,\n ListBox,\n ListBoxItem,\n type ListBoxItemRenderProps,\n type ListBoxRenderProps,\n ListBoxSection,\n Provider,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n pickerClassNames,\n pickerItemStateVars,\n pickerStateVars,\n} from './picker.css';\nimport type { PickerItemProps, PickerProps } from './types';\n\nexport const PickerContext =\n createContext<ContextValue<PickerProps<unknown>, HTMLDivElement>>(null);\n\nexport const PickerItemContext =\n createContext<ContextValue<PickerItemProps<unknown>, HTMLDivElement>>(null);\n\n/**\n * Generic stylable picker that supports the functionality (sans drag and drop) of\n * React Aria's ListBox: https://react-spectrum.adobe.com/react-aria/ListBox.html\n *\n * NOTE: The picker items does not support sections or separators\n */\nexport const Picker = forwardRef(function Picker<T extends object>(\n props: PickerProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n PickerContext,\n );\n\n const finalProps = useDefaultProps(resolvedProps, 'Picker');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n columns,\n items,\n layout = 'stack',\n orientation = 'horizontal',\n selectionMode = 'single',\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledBy,\n ...rest\n } = finalProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(pickerClassNames, theme.Picker, classNamesProp),\n [theme.Picker, classNamesProp],\n );\n\n const values = useMemo<\n [\n [\n typeof PickerItemContext,\n ContextValue<PickerItemProps<unknown>, HTMLDivElement>,\n ],\n ]\n >(() => [[PickerItemContext, { classNames }]], [classNames]);\n\n const style = useCallback(\n ({ state, ...renderProps }: ListBoxRenderProps) =>\n inlineVars(pickerStateVars, {\n ...renderProps,\n columns,\n layout,\n orientation,\n }),\n [columns, layout, orientation],\n );\n\n const children = useMemo(() => {\n if (!(childrenProp || items)) {\n return null;\n }\n\n return (\n <ListBoxSection\n className={classNames?.list?.list}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {typeof childrenProp === 'function' ? (\n <Collection items={items}>{childrenProp}</Collection>\n ) : (\n childrenProp\n )}\n </ListBoxSection>\n );\n }, [childrenProp, items, classNames?.list?.list, ariaLabel, ariaLabelledBy]);\n\n return (\n <Provider values={values}>\n <ListBox<T>\n {...rest}\n ref={resolvedRef}\n className={classNames?.list?.container}\n items={items}\n layout={layout}\n orientation={orientation}\n selectionMode={selectionMode}\n style={style}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n >\n {children}\n </ListBox>\n </Provider>\n );\n});\n\nexport const PickerItem = forwardRef(function PickerItem<T extends object>(\n props: PickerItemProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n const [resolvedProps, resolvedRef] = useContextProps(\n props,\n ref,\n PickerItemContext,\n );\n\n const {\n children: childrenProp,\n id,\n classNames: classNamesProp,\n textValue = typeof childrenProp === 'string' ? childrenProp : undefined,\n ...rest\n } = resolvedProps;\n\n const theme = useTheme();\n\n const classNames = useMemo(\n () => mergeClassNames(pickerClassNames, theme.Picker, classNamesProp),\n [theme.Picker, classNamesProp],\n );\n\n const style = useCallback(\n (renderProps: ListBoxItemRenderProps) =>\n inlineVars(pickerItemStateVars, renderProps),\n [],\n );\n\n const children = useCallback(\n (renderProps: ListBoxItemRenderProps) => (\n <div className={classNames?.item?.item}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </div>\n ),\n [childrenProp, classNames?.item?.item],\n );\n\n return (\n <ListBoxItem<T>\n {...rest}\n ref={resolvedRef as unknown as Ref<T>}\n id={id ?? textValue}\n className={classNames?.item?.container}\n style={style}\n textValue={textValue}\n >\n {children}\n </ListBoxItem>\n );\n});\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../chunk-PZ5AY32C.js';
|
|
2
|
-
import { useContext, useCallback, useMemo } from 'react';
|
|
2
|
+
import { useContext, useCallback, useMemo, createElement } from 'react';
|
|
3
3
|
import { useValueSelector, isOptionGroupArray } from 'react-querybuilder';
|
|
4
4
|
import { callRenderProps } from '../../utils/props/index.js';
|
|
5
|
-
import {
|
|
5
|
+
import { AriaListBoxSection, AriaHeader, AriaSelectValue } from '../aria/index.js';
|
|
6
6
|
import { Button } from '../button/index.js';
|
|
7
7
|
import { OptionsItem, OptionsList, Options } from '../options/index.js';
|
|
8
8
|
import { Select } from '../select/index.js';
|
|
@@ -37,7 +37,7 @@ function ValueSelector({
|
|
|
37
37
|
[onChange]
|
|
38
38
|
);
|
|
39
39
|
const options = useMemo(
|
|
40
|
-
() => isOptionGroupArray(optionsProp) ? optionsProp.map((section) => /* @__PURE__ */ jsxs(
|
|
40
|
+
() => isOptionGroupArray(optionsProp) ? optionsProp.map((section) => /* @__PURE__ */ jsxs(AriaListBoxSection, { children: [
|
|
41
41
|
/* @__PURE__ */ jsx(AriaHeader, { children: section.label }),
|
|
42
42
|
section.options.map((option) => /* @__PURE__ */ jsx(OptionsItem, { id: option.name, children: option.label }, option.name))
|
|
43
43
|
] }, section.label)) : optionsProp.map((option) => /* @__PURE__ */ jsx(OptionsItem, { id: option.name, children: option.label }, option.name)),
|
|
@@ -54,23 +54,23 @@ function ValueSelector({
|
|
|
54
54
|
"aria-label": title,
|
|
55
55
|
children: options
|
|
56
56
|
}
|
|
57
|
-
) : /* @__PURE__ */
|
|
57
|
+
) : /* @__PURE__ */ createElement(
|
|
58
58
|
Select,
|
|
59
59
|
{
|
|
60
60
|
...rest,
|
|
61
|
-
|
|
61
|
+
key: Array.isArray(val) ? val[0] : val,
|
|
62
62
|
size,
|
|
63
63
|
isInvalid: title === "Value" && !validation,
|
|
64
|
-
|
|
65
|
-
"aria-label": title
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
64
|
+
onChange: handleSelectionChange,
|
|
65
|
+
"aria-label": title
|
|
66
|
+
},
|
|
67
|
+
(renderProps) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsxs(Button, { children: [
|
|
69
|
+
/* @__PURE__ */ jsx(AriaSelectValue, { children: ({ selectedText }) => selectedText }),
|
|
70
|
+
callRenderProps(icons?.select, renderProps)
|
|
71
|
+
] }),
|
|
72
|
+
/* @__PURE__ */ jsx(Options, { children: /* @__PURE__ */ jsx(OptionsList, { children: options }) })
|
|
73
|
+
] })
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/query-builder/value-selector.tsx"],"names":[],"mappings":";;;;;;;;;;;AA4BO,SAAS,aAAA,CAAiD;AAAA,EAC/D,cAAA;AAAA,EACA,aAAA;AAAA,EACA,OAAA,EAAS,WAAA;AAAA,EACT,QAAA;AAAA,EACA,KAAA;AAAA,EACA,UAAA;AAAA,EACA,KAAA;AAAA,EACA,GAAG;AACL,CAAA,EAA0B;AACxB,EAAA,MAAM,EAAE,KAAA,EAAO,IAAA,EAAK,GAAI,WAAW,mBAAmB,CAAA;AAEtD,EAAA,MAAM,EAAE,QAAA,EAAU,GAAA,EAAI,GAAI,gBAAA,CAAiB;AAAA,IACzC,cAAA;AAAA,IACA,aAAA;AAAA,IACA,QAAA;AAAA,IACA;AAAA,GACD,CAAA;AAED,EAAA,MAAM,qBAAA,GAAwB,WAAA;AAAA,IAC5B,CAAC,SAAA,KAA0B;AACzB,MAAA,QAAA,CAAS,SAAA,GAAY,CAAA,EAAG,SAAS,CAAA,CAAA,GAAK,EAAE,CAAA;AAAA,IAC1C,CAAA;AAAA,IACA,CAAC,QAAQ;AAAA,GACX;AAEA,EAAA,MAAM,uBAAA,GAA0B,WAAA;AAAA,IAC9B,CAAC,SAAoB,QAAA,CAAS,CAAC,GAAG,IAAI,CAAA,CAAE,IAAA,CAAK,IAAI,CAAC,CAAA;AAAA,IAClD,CAAC,QAAQ;AA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AAA;AAAA,QACC,eAAA,CAAgB,KAAA,EAAO,MAAA,EAAQ,WAAW;AAAA,OAAA,EAC7C,CAAA;AAAA,sBACA,GAAA,CAAC,OAAA,EAAA,EACC,QAAA,kBAAA,GAAA,CAAC,WAAA,EAAA,EAAa,mBAAQ,CAAA,EACxB;AAAA,KAAA,EACF;AAAA,GAEJ;AAEJ","file":"value-selector.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 type { Key } from '@react-types/shared';\nimport { useCallback, useContext, useMemo } from 'react';\nimport type { Selection } from 'react-aria-components';\nimport {\n type FullOption,\n type ValueSelectorProps,\n isOptionGroupArray,\n useValueSelector,\n} from 'react-querybuilder';\nimport { callRenderProps } from '../../utils/props';\nimport { AriaHeader, AriaListBoxSection, AriaSelectValue } from '../aria';\nimport { Button } from '../button';\nimport { Options, OptionsItem, OptionsList } from '../options';\nimport { Select } from '../select';\nimport { QueryBuilderContext } from './constants';\n\nexport function ValueSelector<T extends FullOption = FullOption>({\n handleOnChange,\n listsAsArrays,\n options: optionsProp,\n multiple,\n title,\n validation,\n value,\n ...rest\n}: ValueSelectorProps<T>) {\n const { icons, size } = useContext(QueryBuilderContext);\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 onChange(selection ? `${selection}` : []);\n },\n [onChange],\n );\n\n const handleMultiSelectChange = useCallback(\n (keys: Selection) => onChange([...keys].join(', ')),\n [onChange],\n );\n\n const options = useMemo(\n () =>\n isOptionGroupArray(optionsProp)\n ? optionsProp.map((section) => (\n <AriaListBoxSection key={section.label}>\n <AriaHeader>{section.label}</AriaHeader>\n {section.options.map((option) => (\n <OptionsItem id={option.name} key={option.name}>\n {option.label}\n </OptionsItem>\n ))}\n </AriaListBoxSection>\n ))\n : optionsProp.map((option) => (\n <OptionsItem id={option.name} key={option.name}>\n {option.label}\n </OptionsItem>\n )),\n [optionsProp],\n );\n\n return multiple ? (\n <OptionsList // TODO: Replace with ChipField when it exists\n {...rest}\n selectedKeys={val}\n selectionMode='multiple'\n size={size}\n onSelectionChange={handleMultiSelectChange}\n aria-label={title}\n >\n {options}\n </OptionsList>\n ) : (\n <Select\n {...rest}\n key={Array.isArray(val) ? val[0] : val}\n size={size}\n isInvalid={title === 'Value' && !validation}\n onChange={handleSelectionChange}\n aria-label={title}\n >\n {(renderProps) => (\n <>\n <Button>\n <AriaSelectValue>\n {({ selectedText }) => selectedText}\n </AriaSelectValue>\n {callRenderProps(icons?.select, renderProps)}\n </Button>\n <Options>\n <OptionsList>{options}</OptionsList>\n </Options>\n </>\n )}\n </Select>\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/select/index.tsx"],"names":["Select","
|
|
1
|
+
{"version":3,"sources":["../../../src/components/select/index.tsx"],"names":["Select","RACSelect"],"mappings":";;;;;;;;;;;;;;;AAgDA,IAAM,cAAA,GAAgC;AAAA,EACpC,WAAA,EAAa;AAAA,IACX,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,KAAA,EAAO;AAAA,IACL,IAAI,MAAA,CAAO,EAAA;AAAA,IACX,IAAI,MAAA,CAAO;AAAA,GACb;AAAA,EACA,MAAA,EAAQ;AAAA,IACN,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAAS,QAAA,EAAS;AAAA,IACpC,EAAA,EAAI,EAAE,IAAA,EAAM,IAAA,EAAM,SAA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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 {\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ContextValue,\n type FieldErrorProps,\n type LabelProps,\n Provider,\n Select as RACSelect,\n type SelectRenderProps as RACSelectRenderProps,\n type SelectValueProps,\n type TextProps,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks/use-context-props';\nimport { useDefaultProps } from '../../hooks/use-defaults';\nimport { useTheme } from '../../hooks/use-theme';\nimport { bodies } from '../../styles/typography.css';\nimport { inlineVars } from '../../utils/css';\nimport { callRenderProps, mergeClassNames } from '../../utils/props';\nimport {\n AriaFieldErrorContext,\n AriaLabelContext,\n AriaSelectValueContext,\n AriaTextContext,\n} from '../aria';\nimport { ButtonContext } from '../button';\nimport type { ButtonProps } from '../button/types';\nimport { OptionsContext } from '../options';\nimport type { OptionsProps } from '../options/types';\nimport { selectClassNames, selectStateVars } from './select.css';\nimport type { SelectMapping, SelectProps } from './types';\n\nconst defaultMapping: SelectMapping = {\n description: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n error: {\n sm: bodies.xs,\n lg: bodies.xs,\n },\n toggle: {\n sm: { size: 'sm', variant: 'hollow' },\n lg: { size: 'md', variant: 'hollow' },\n },\n};\n\nexport const SelectContext =\n createContext<ContextValue<SelectProps<object>, HTMLDivElement>>(null);\n\nexport const Select = forwardRef(function Select<T extends object>(\n props: SelectProps<T>,\n ref: ForwardedRef<HTMLDivElement>,\n) {\n [props, ref] = useContextProps(props, ref, SelectContext);\n props = useDefaultProps(props, 'Select');\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n mapping: mappingProp,\n size = 'lg',\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(selectClassNames, theme.Select, classNamesProp, {\n description: mapping.description[size],\n error: mapping.error[size],\n }),\n [classNamesProp, theme.Select, mapping, size],\n );\n\n const values = useMemo<\n [\n [typeof AriaLabelContext, ContextValue<LabelProps, HTMLLabelElement>],\n [typeof ButtonContext, ContextValue<ButtonProps, HTMLButtonElement>],\n [\n typeof AriaSelectValueContext,\n ContextValue<SelectValueProps<object>, HTMLSpanElement>,\n ],\n [typeof AriaTextContext, ContextValue<TextProps, HTMLElement>],\n [\n typeof AriaFieldErrorContext,\n ContextValue<FieldErrorProps, HTMLElement>,\n ],\n [typeof OptionsContext, ContextValue<OptionsProps, HTMLElement>],\n ]\n >(\n () => [\n [AriaLabelContext, { className: classNames?.label }],\n [\n ButtonContext,\n {\n ...mapping.toggle[size],\n classNames: classNames?.toggle,\n },\n ],\n [\n AriaSelectValueContext,\n {\n className: classNames?.value,\n },\n ],\n [\n AriaTextContext,\n {\n slots: {\n description: { className: classNames?.description },\n },\n },\n ],\n [AriaFieldErrorContext, { className: classNames?.error }],\n [OptionsContext, { classNames: classNames?.options, size }],\n ],\n [classNames, mapping, size],\n );\n\n const style = useCallback(\n (renderProps: RACSelectRenderProps) =>\n inlineVars(selectStateVars, {\n ...renderProps,\n size,\n }),\n [size],\n );\n\n const children = useCallback(\n (renderProps: RACSelectRenderProps) => (\n <div className={classNames?.select}>\n <Provider values={values}>\n {callRenderProps(childrenProp, {\n ...renderProps,\n defaultChildren: null,\n })}\n </Provider>\n </div>\n ),\n [childrenProp, values, classNames?.select],\n );\n\n return (\n <RACSelect\n {...props}\n ref={ref}\n className={classNames?.container}\n style={style}\n >\n {children}\n </RACSelect>\n );\n});\n"]}
|
|
@@ -8,22 +8,19 @@ import '../input/types.js';
|
|
|
8
8
|
|
|
9
9
|
declare const TextFieldContext: react.Context<ContextValue<TextFieldProps, HTMLDivElement>>;
|
|
10
10
|
declare const TextField: (props: {
|
|
11
|
-
id?: string | undefined;
|
|
12
11
|
children?: react.ReactNode | ((values: TextFieldRenderProps & {
|
|
13
12
|
defaultChildren: react.ReactNode | undefined;
|
|
14
13
|
}) => react.ReactNode);
|
|
15
|
-
type?: "text" | "search" | "url" | "tel" | "email" | "password" | (string & {}) | undefined;
|
|
16
|
-
pattern?: string | undefined;
|
|
17
|
-
value?: string | undefined;
|
|
18
|
-
hidden?: boolean | undefined | undefined;
|
|
19
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
20
14
|
slot?: string | null | undefined;
|
|
21
15
|
defaultValue?: string | undefined;
|
|
22
16
|
autoFocus?: boolean | undefined;
|
|
23
17
|
dir?: string | undefined | undefined;
|
|
24
18
|
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
|
|
19
|
+
hidden?: boolean | undefined | undefined;
|
|
20
|
+
id?: string | undefined;
|
|
25
21
|
lang?: string | undefined | undefined;
|
|
26
22
|
spellCheck?: string | undefined;
|
|
23
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
27
24
|
autoCorrect?: string | undefined;
|
|
28
25
|
inert?: boolean | undefined | undefined;
|
|
29
26
|
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
|
|
@@ -115,6 +112,9 @@ declare const TextField: (props: {
|
|
|
115
112
|
onTransitionStart?: react.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
116
113
|
onTransitionStartCapture?: react.TransitionEventHandler<HTMLDivElement> | undefined;
|
|
117
114
|
form?: string | undefined;
|
|
115
|
+
value?: string | undefined;
|
|
116
|
+
type?: "text" | "search" | "url" | "tel" | "email" | "password" | (string & {}) | undefined;
|
|
117
|
+
pattern?: string | undefined;
|
|
118
118
|
isDisabled?: boolean | undefined;
|
|
119
119
|
onFocusChange?: ((isFocused: boolean) => void) | undefined;
|
|
120
120
|
name?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext } from './components/aria/index.js';
|
|
1
|
+
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaListBoxSection, AriaListBoxSectionContext, AriaMenuSection, AriaMenuSectionContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext } from './components/aria/index.js';
|
|
2
2
|
export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext } from './components/button/index.js';
|
|
3
3
|
export { buttonClassNames, buttonColorVars, buttonContainer, buttonSpaceVars, buttonStateVars } from './components/button/button.css.js';
|
|
4
4
|
export { ButtonClassNames, ButtonColors, ButtonMapping, ButtonProps, ButtonRenderProps, ButtonSizes, ButtonState, ButtonVariants, LinkButtonProps, ToggleButtonProps } from './components/button/types.js';
|
|
@@ -75,12 +75,12 @@ export { SwitchAlignment, SwitchClassNames, SwitchProps, SwitchRenderProps, Swit
|
|
|
75
75
|
export { Tab, TabContext, TabList, TabListContext, TabPanel, TabPanelContext, TabPanels, TabPanelsContext, Tabs, TabsContext } from './components/tabs/index.js';
|
|
76
76
|
export { tabColorVars, tabListStateVars, tabPanelStateVars, tabPanelsStateVars, tabSpaceVars, tabStateVars, tabsClassNames, tabsContainers } from './components/tabs/tabs.css.js';
|
|
77
77
|
export { TabListAlignment, TabListAnchor, TabListProps, TabListState, TabListVariants, TabPanelProps, TabPanelRenderProps, TabPanelState, TabPanelsProps, TabPanelsState, TabProps, TabRenderProps, TabState, TabsClassNames, TabsProps } from './components/tabs/types.js';
|
|
78
|
-
export { TextArea, TextAreaContext } from './components/textarea/index.js';
|
|
79
|
-
export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './components/textarea/textarea.css.js';
|
|
80
|
-
export { TextAreaClassNames, TextAreaProps, TextAreaRenderProps, TextAreaState } from './components/textarea/types.js';
|
|
81
78
|
export { TextField, TextFieldContext } from './components/text-field/index.js';
|
|
82
79
|
export { textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldSpaceVars, textFieldStateVars } from './components/text-field/text-field.css.js';
|
|
83
80
|
export { TextFieldClassNames, TextFieldMapping, TextFieldProps, TextFieldSizes, TextFieldState } from './components/text-field/types.js';
|
|
81
|
+
export { TextArea, TextAreaContext } from './components/textarea/index.js';
|
|
82
|
+
export { textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars } from './components/textarea/textarea.css.js';
|
|
83
|
+
export { TextAreaClassNames, TextAreaProps, TextAreaRenderProps, TextAreaState } from './components/textarea/types.js';
|
|
84
84
|
export { TimeField, TimeFieldContext } from './components/time-field/index.js';
|
|
85
85
|
export { timeFieldClassNames, timeFieldColorVars, timeFieldContainer, timeFieldSpaceVars, timeFieldStateVars } from './components/time-field/time-field.css.js';
|
|
86
86
|
export { TimeFieldClassNames, TimeFieldMapping, TimeFieldProps, TimeFieldRenderProps, TimeFieldSizes, TimeFieldState } from './components/time-field/types.js';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './chunk-PZ5AY32C.js';
|
|
2
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext, Button, ButtonContext, Checkbox, CheckboxContext, CheckboxGroup, CheckboxGroupContext, Chip, ChipContext, ChipGroup, ChipGroupContext, ChipItem, ChipList, ComboBox, ComboBoxContext, DateField, DateInput, DateInputContext, DateSegment, DateSegmentContext, DateSegments, Dialog, DialogContext, Drawer, DrawerDialog, DrawerDialogContext, DrawerTab, DrawerTabList, Element, ElementContext, Group, GroupContext, Icon, IconContext, Input, InputContext, LinkButton, LinkButtonContext, Menu, MenuContext, MenuItem, MenuItemContext, MenuList, MenuListContext, MergeProvider, NumberField, NumberFieldContext, Options, OptionsContext, OptionsItem, OptionsItemContext, OptionsList, OptionsListContext, Picker, PickerContext, PickerItem, PickerItemContext, Popover, PopoverContext, QueryBuilder, QueryBuilderContext, Radio, RadioContext, RadioGroup, RadioGroupContext, SearchField, SearchFieldContext, Select, SelectContext, Slider, SliderBar, SliderBarContext, SliderContext, SliderOutput, SliderOutputContext, SliderThumb, SliderThumbContext, SliderTrack, SliderTrackContext, Switch, SwitchContext, Tab, TabContext, TabList, TabListContext, TabPanel, TabPanelContext, TabPanels, TabPanelsContext, Tabs, TabsContext, TextArea, TextAreaContext, TextField, TextFieldContext, TimeField, TimeFieldContext, ToggleButton, ToggleButtonContext, Tooltip, TooltipContext, TooltipTarget, TooltipTargetContext, Tree, TreeGroup, TreeItem, TreeStateContext, buttonClassNames, buttonColorVars, buttonContainer, buttonSpaceVars, buttonStateVars, checkboxClassNames, checkboxColorVars, checkboxContainer, checkboxGroupContainer, checkboxGroupStateVars, checkboxSpaceVars, checkboxStateVars, chipClassNames, chipColorVars, chipContainer, chipSpaceVars, chipStateVars, comboBoxClassNames, comboBoxColorVars, comboBoxContainer, comboBoxSpaceVars, comboBoxStateVars, createCollectionRenderer, dateFieldClassNames, dateFieldColorVars, dateFieldContainer, dateFieldSpaceVars, dateFieldStateVars, dateInputClassNames, dateInputColorVars, dateInputContainer, dateInputSpaceVars, dateInputStateVars, dateSegmentStateVars, dateSegmentsContainer, dialogClassNames, dialogColorVars, dialogContainer, dialogSpaceVars, dialogStateVars, drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars, groupClassNames, groupContainer, groupSpaceVars, groupStateVars, iconClassNames, iconColorVars, iconContainer, iconSpaceVars, iconStateVars, inputClassNames, inputColorVars, inputContainer, inputSpaceVars, inputStateVars, menuClassNames, menuColorVars, menuContainers, menuItemStateVars, menuSpaceVars, menuStateVars, numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars, optionsClassNames, optionsColorVars, optionsContainers, optionsItemStateVars, optionsListStateVars, optionsSpaceVars, optionsStateVars, pickerClassNames, pickerContainers, pickerItemColorVars, pickerItemStateVars, pickerSpaceVars, pickerStateVars, popoverClassNames, popoverColorVars, popoverContainer, popoverSpaceVars, popoverStateVars, pressToMouseEvent, queryBuilderClassNames, queryBuilderColorVars, queryBuilderContainers, queryBuilderGroupStateVars, queryBuilderRuleStateVars, queryBuilderSpaceVars, queryBuilderStateVars, radioClassNames, radioColorVars, radioGroupStateVars, radioSpaceVars, radioStateVars, searchFieldClassNames, searchFieldContainer, searchFieldSpaceVars, searchFieldStateVars, selectClassNames, selectColorVars, selectContainer, selectSpaceVars, selectStateVars, sliderClassNames, sliderColorVars, sliderSpaceVars, sliderStateVars, sliderThumbStateVars, sliderTrackStateVars, switchClassNames, switchColorVars, switchContainer, switchSpaceVars, switchStateVars, tabColorVars, tabListStateVars, tabPanelStateVars, tabPanelsStateVars, tabSpaceVars, tabStateVars, tabsClassNames, tabsContainers, textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars, textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldSpaceVars, textFieldStateVars, timeFieldClassNames, timeFieldColorVars, timeFieldContainer, timeFieldSpaceVars, timeFieldStateVars, tooltipClassNames, tooltipContainers, tooltipSpaceVars, tooltipStateVars, tooltipTargetStateVars, treeClassNames, treeColorVars, treeContainers, treeGroupStateVars, treeIndicatorStateVars, treeItemStateVars, treeSpaceVars, treeStateVars } from './components/index.js';
|
|
2
|
+
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaListBoxSection, AriaListBoxSectionContext, AriaMenuSection, AriaMenuSectionContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext, Button, ButtonContext, Checkbox, CheckboxContext, CheckboxGroup, CheckboxGroupContext, Chip, ChipContext, ChipGroup, ChipGroupContext, ChipItem, ChipList, ComboBox, ComboBoxContext, DateField, DateInput, DateInputContext, DateSegment, DateSegmentContext, DateSegments, Dialog, DialogContext, Drawer, DrawerDialog, DrawerDialogContext, DrawerTab, DrawerTabList, Element, ElementContext, Group, GroupContext, Icon, IconContext, Input, InputContext, LinkButton, LinkButtonContext, Menu, MenuContext, MenuItem, MenuItemContext, MenuList, MenuListContext, MergeProvider, NumberField, NumberFieldContext, Options, OptionsContext, OptionsItem, OptionsItemContext, OptionsList, OptionsListContext, Picker, PickerContext, PickerItem, PickerItemContext, Popover, PopoverContext, QueryBuilder, QueryBuilderContext, Radio, RadioContext, RadioGroup, RadioGroupContext, SearchField, SearchFieldContext, Select, SelectContext, Slider, SliderBar, SliderBarContext, SliderContext, SliderOutput, SliderOutputContext, SliderThumb, SliderThumbContext, SliderTrack, SliderTrackContext, Switch, SwitchContext, Tab, TabContext, TabList, TabListContext, TabPanel, TabPanelContext, TabPanels, TabPanelsContext, Tabs, TabsContext, TextArea, TextAreaContext, TextField, TextFieldContext, TimeField, TimeFieldContext, ToggleButton, ToggleButtonContext, Tooltip, TooltipContext, TooltipTarget, TooltipTargetContext, Tree, TreeGroup, TreeItem, TreeStateContext, buttonClassNames, buttonColorVars, buttonContainer, buttonSpaceVars, buttonStateVars, checkboxClassNames, checkboxColorVars, checkboxContainer, checkboxGroupContainer, checkboxGroupStateVars, checkboxSpaceVars, checkboxStateVars, chipClassNames, chipColorVars, chipContainer, chipSpaceVars, chipStateVars, comboBoxClassNames, comboBoxColorVars, comboBoxContainer, comboBoxSpaceVars, comboBoxStateVars, createCollectionRenderer, dateFieldClassNames, dateFieldColorVars, dateFieldContainer, dateFieldSpaceVars, dateFieldStateVars, dateInputClassNames, dateInputColorVars, dateInputContainer, dateInputSpaceVars, dateInputStateVars, dateSegmentStateVars, dateSegmentsContainer, dialogClassNames, dialogColorVars, dialogContainer, dialogSpaceVars, dialogStateVars, drawerAnimationVars, drawerClassNames, drawerColorVars, drawerContainer, drawerDialogStateVars, drawerSpaceVars, drawerStateVars, groupClassNames, groupContainer, groupSpaceVars, groupStateVars, iconClassNames, iconColorVars, iconContainer, iconSpaceVars, iconStateVars, inputClassNames, inputColorVars, inputContainer, inputSpaceVars, inputStateVars, menuClassNames, menuColorVars, menuContainers, menuItemStateVars, menuSpaceVars, menuStateVars, numberFieldClassNames, numberFieldColorVars, numberFieldContainer, numberFieldSpaceVars, numberFieldStateVars, optionsClassNames, optionsColorVars, optionsContainers, optionsItemStateVars, optionsListStateVars, optionsSpaceVars, optionsStateVars, pickerClassNames, pickerContainers, pickerItemColorVars, pickerItemStateVars, pickerSpaceVars, pickerStateVars, popoverClassNames, popoverColorVars, popoverContainer, popoverSpaceVars, popoverStateVars, pressToMouseEvent, queryBuilderClassNames, queryBuilderColorVars, queryBuilderContainers, queryBuilderGroupStateVars, queryBuilderRuleStateVars, queryBuilderSpaceVars, queryBuilderStateVars, radioClassNames, radioColorVars, radioGroupStateVars, radioSpaceVars, radioStateVars, searchFieldClassNames, searchFieldContainer, searchFieldSpaceVars, searchFieldStateVars, selectClassNames, selectColorVars, selectContainer, selectSpaceVars, selectStateVars, sliderClassNames, sliderColorVars, sliderSpaceVars, sliderStateVars, sliderThumbStateVars, sliderTrackStateVars, switchClassNames, switchColorVars, switchContainer, switchSpaceVars, switchStateVars, tabColorVars, tabListStateVars, tabPanelStateVars, tabPanelsStateVars, tabSpaceVars, tabStateVars, tabsClassNames, tabsContainers, textAreaClassNames, textAreaColorVars, textAreaContainer, textAreaSpaceVars, textAreaStateVars, textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldSpaceVars, textFieldStateVars, timeFieldClassNames, timeFieldColorVars, timeFieldContainer, timeFieldSpaceVars, timeFieldStateVars, tooltipClassNames, tooltipContainers, tooltipSpaceVars, tooltipStateVars, tooltipTargetStateVars, treeClassNames, treeColorVars, treeContainers, treeGroupStateVars, treeIndicatorStateVars, treeItemStateVars, treeSpaceVars, treeStateVars } from './components/index.js';
|
|
3
3
|
export { DefaultsProvider, ThemeProvider, useCollectionRender, useContextProps, useDefaultProps, useDefaults, usePropagatingPress, useSlot, useTheme, useTree, useUpdateEffect } from './hooks/index.js';
|
|
4
4
|
export { bodies, defaultElevationVarValues, defaultElevations, defaultFocus, defaultFocusVarValues, defaultGenericColorVarValues, defaultGenericColors, defaultRadius, defaultRadiusVarValues, defaultSemanticColorVarValues, defaultSemanticColors, defaultSizes, defaultSizesVarValues, defaultSpace, defaultSpaceVarValues, defaultTypography, defaultTypographyVarValues, defaultZIndex, defaultZIndexVarValues, elevationVars, families, focusOutlineStyle, focusVars, genericColorVars, headings, inputs, label, layers, radiusVars, semanticColorVars, sizeVars, spaceVars, surfaces, typographyVars, zIndexVars } from './styles/index.js';
|
|
5
5
|
export { alphaChannelAsNumberValidator, alphaChannelAsStringValidator, applyThemeVars, assignPartialVars, callRenderProps, colorChannelAsNumberValidator, colorChannelAsStringValidator, computeContract, containerQueries, containerQuery, continuePropagation, inlineVars, mergeClassNames, mergeProps, pixelValueAsNumberValidator, pixelValueAsStringValidator, rgbaAsStringValidator, rgbaAsTupleValidator, unwrapCssVar, wrapRenderProps } from './utils/index.js';
|