@accelint/design-toolkit 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.d.ts +1 -5
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/accordion/types.d.ts +9 -10
- package/dist/components/avatar/index.d.ts +4 -2
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.d.ts +16 -15
- package/dist/components/avatar/styles.js +1 -1
- package/dist/components/avatar/styles.js.map +1 -1
- package/dist/components/avatar/types.d.ts +7 -7
- package/dist/components/badge/index.d.ts +3 -2
- package/dist/components/badge/index.js +1 -1
- package/dist/components/badge/index.js.map +1 -1
- package/dist/components/badge/styles.js +1 -1
- package/dist/components/badge/styles.js.map +1 -1
- package/dist/components/badge/types.d.ts +3 -4
- package/dist/components/box/index.js +1 -1
- package/dist/components/box/index.js.map +1 -1
- package/dist/components/button/index.d.ts +6 -4
- package/dist/components/button/index.js +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.d.ts +25 -24
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +3 -5
- package/dist/components/checkbox/index.js +1 -1
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/checkbox/styles.d.ts +19 -18
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +4 -2
- package/dist/components/chip/index.js +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.d.ts +70 -69
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/chip/types.d.ts +5 -5
- package/dist/components/classification-badge/index.d.ts +3 -2
- package/dist/components/classification-badge/index.js +1 -1
- package/dist/components/classification-badge/index.js.map +1 -1
- package/dist/components/classification-badge/styles.js +1 -1
- package/dist/components/classification-badge/styles.js.map +1 -1
- package/dist/components/classification-badge/types.d.ts +3 -4
- package/dist/components/classification-banner/index.d.ts +3 -2
- package/dist/components/classification-banner/index.js +1 -1
- package/dist/components/classification-banner/index.js.map +1 -1
- package/dist/components/classification-banner/styles.js +1 -1
- package/dist/components/classification-banner/styles.js.map +1 -1
- package/dist/components/classification-banner/types.d.ts +3 -4
- package/dist/components/color-picker/index.d.ts +45 -15
- package/dist/components/color-picker/index.js +1 -1
- package/dist/components/color-picker/index.js.map +1 -1
- package/dist/components/color-picker/styles.d.ts +42 -0
- package/dist/components/color-picker/styles.js +2 -0
- package/dist/components/color-picker/styles.js.map +1 -0
- package/dist/components/color-picker/types.d.ts +13 -0
- package/dist/components/color-picker/types.js +2 -0
- package/dist/components/color-picker/types.js.map +1 -0
- package/dist/components/combobox/index.d.ts +9 -14
- package/dist/components/combobox/index.js +1 -1
- package/dist/components/combobox/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +8 -24
- package/dist/components/date-field/index.js +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.d.ts +69 -0
- package/dist/components/date-field/styles.js +2 -0
- package/dist/components/date-field/styles.js.map +1 -0
- package/dist/components/date-field/types.d.ts +29 -0
- package/dist/components/date-field/types.js +2 -0
- package/dist/components/date-field/types.js.map +1 -0
- package/dist/components/details-list/index.d.ts +59 -0
- package/dist/components/details-list/index.js +2 -0
- package/dist/components/details-list/index.js.map +1 -0
- package/dist/components/details-list/styles.d.ts +65 -0
- package/dist/components/details-list/styles.js +2 -0
- package/dist/components/details-list/styles.js.map +1 -0
- package/dist/components/details-list/types.d.ts +16 -0
- package/dist/components/details-list/types.js +2 -0
- package/dist/components/details-list/types.js.map +1 -0
- package/dist/components/dialog/index.d.ts +1 -0
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/context.d.ts +13 -0
- package/dist/components/drawer/context.js +2 -0
- package/dist/components/drawer/context.js.map +1 -0
- package/dist/components/drawer/index.d.ts +48 -0
- package/dist/components/drawer/index.js +2 -0
- package/dist/components/drawer/index.js.map +1 -0
- package/dist/components/drawer/state.d.ts +26 -0
- package/dist/components/drawer/state.js +2 -0
- package/dist/components/drawer/state.js.map +1 -0
- package/dist/components/drawer/styles.d.ts +118 -0
- package/dist/components/drawer/styles.js +2 -0
- package/dist/components/drawer/styles.js.map +1 -0
- package/dist/components/drawer/types.d.ts +279 -0
- package/dist/components/drawer/types.js +2 -0
- package/dist/components/drawer/types.js.map +1 -0
- package/dist/components/hero/index.d.ts +45 -0
- package/dist/components/hero/index.js +2 -0
- package/dist/components/hero/index.js.map +1 -0
- package/dist/components/hero/styles.d.ts +48 -0
- package/dist/components/hero/styles.js +2 -0
- package/dist/components/hero/styles.js.map +1 -0
- package/dist/components/hero/types.d.ts +13 -0
- package/dist/components/hero/types.js +2 -0
- package/dist/components/hero/types.js.map +1 -0
- package/dist/components/icon/index.d.ts +3 -2
- package/dist/components/icon/index.js +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/icon/styles.js +1 -1
- package/dist/components/icon/styles.js.map +1 -1
- package/dist/components/icon/types.d.ts +4 -5
- package/dist/components/input/index.d.ts +1 -0
- package/dist/components/input/index.js +1 -1
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/input/styles.js +1 -1
- package/dist/components/input/styles.js.map +1 -1
- package/dist/components/input/types.d.ts +1 -0
- package/dist/components/label/index.d.ts +3 -2
- package/dist/components/label/index.js +1 -1
- package/dist/components/label/index.js.map +1 -1
- package/dist/components/label/styles.js +1 -1
- package/dist/components/label/styles.js.map +1 -1
- package/dist/components/label/types.d.ts +2 -3
- package/dist/components/menu/index.d.ts +16 -21
- package/dist/components/menu/index.js +1 -1
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/menu/styles.js +1 -1
- package/dist/components/menu/styles.js.map +1 -1
- package/dist/components/navigation-stack/index.d.ts +20 -0
- package/dist/components/navigation-stack/index.js +2 -0
- package/dist/components/navigation-stack/index.js.map +1 -0
- package/dist/components/navigation-stack/types.d.ts +31 -0
- package/dist/components/navigation-stack/types.js +2 -0
- package/dist/components/navigation-stack/types.js.map +1 -0
- package/dist/components/options/index.d.ts +28 -22
- package/dist/components/options/index.js +1 -1
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/options/styles.d.ts +72 -0
- package/dist/components/options/styles.js +2 -0
- package/dist/components/options/styles.js.map +1 -0
- package/dist/components/options/types.d.ts +29 -0
- package/dist/components/options/types.js +2 -0
- package/dist/components/options/types.js.map +1 -0
- package/dist/components/popover/index.js +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +16 -15
- package/dist/components/popover/styles.js +1 -1
- package/dist/components/popover/styles.js.map +1 -1
- package/dist/components/query-builder/action-element.js +1 -1
- package/dist/components/query-builder/action-element.js.map +1 -1
- package/dist/components/query-builder/constants.js +1 -1
- package/dist/components/query-builder/constants.js.map +1 -1
- package/dist/components/query-builder/group.js +1 -1
- package/dist/components/query-builder/group.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +5 -20
- package/dist/components/query-builder/index.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule.js +1 -1
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/types.d.ts +22 -0
- package/dist/components/query-builder/types.js +2 -0
- package/dist/components/query-builder/types.js.map +1 -0
- package/dist/components/query-builder/utils.js +1 -1
- package/dist/components/query-builder/utils.js.map +1 -1
- package/dist/components/query-builder/value-editor.js +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/index.js +1 -1
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/radio/styles.d.ts +19 -18
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/radio/types.d.ts +2 -3
- package/dist/components/search-field/index.d.ts +56 -15
- package/dist/components/search-field/index.js +1 -1
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/styles.d.ts +53 -0
- package/dist/components/search-field/styles.js +2 -0
- package/dist/components/search-field/styles.js.map +1 -0
- package/dist/components/search-field/types.d.ts +25 -0
- package/dist/components/search-field/types.js +2 -0
- package/dist/components/search-field/types.js.map +1 -0
- package/dist/components/skeleton/index.d.ts +42 -0
- package/dist/components/skeleton/index.js +2 -0
- package/dist/components/skeleton/index.js.map +1 -0
- package/dist/components/skeleton/styles.d.ts +23 -0
- package/dist/components/skeleton/styles.js +2 -0
- package/dist/components/skeleton/styles.js.map +1 -0
- package/dist/components/skeleton/types.d.ts +8 -0
- package/dist/components/skeleton/types.js +2 -0
- package/dist/components/skeleton/types.js.map +1 -0
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/switch/index.d.ts +3 -2
- package/dist/components/switch/index.js +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +13 -12
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/switch/types.d.ts +2 -3
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-area-field/index.d.ts +4 -3
- package/dist/components/text-area-field/index.js +1 -1
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.d.ts +19 -18
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-area-field/types.d.ts +2 -3
- package/dist/components/text-field/index.d.ts +4 -2
- package/dist/components/text-field/index.js +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.d.ts +19 -18
- package/dist/components/text-field/styles.js +1 -1
- package/dist/components/text-field/styles.js.map +1 -1
- package/dist/components/text-field/types.d.ts +4 -4
- package/dist/components/tooltip/index.d.ts +14 -28
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +5 -0
- package/dist/components/tooltip/styles.js +2 -0
- package/dist/components/tooltip/styles.js.map +1 -0
- package/dist/components/tooltip/types.d.ts +8 -0
- package/dist/components/tooltip/types.js +2 -0
- package/dist/components/tooltip/types.js.map +1 -0
- package/dist/icons/catalog.js +1 -1
- package/dist/index.d.ts +54 -28
- package/dist/index.js +1 -1
- package/dist/lib/react.d.ts +13 -12
- package/dist/lib/react.js +4 -4
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/types.d.ts +6 -2
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/styles.css +1341 -278
- package/dist/tokens/index.js +1 -1
- package/dist/tokens/index.js.map +1 -1
- package/dist/variants/variants.css +6 -0
- package/package.json +81 -58
- package/dist/components/options-item/index.d.ts +0 -30
- package/dist/components/options-item/index.js +0 -2
- package/dist/components/options-item/index.js.map +0 -1
- package/dist/components/query-builder/example-configuration.d.ts +0 -30
- package/dist/components/query-builder/example-configuration.js +0 -2
- package/dist/components/query-builder/example-configuration.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/input/styles.ts"],"names":["e"],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/input/styles.ts"],"names":["InputStyles","tv","e"],"mappings":"sCAeQ,MAAA,CAAA,CAAA,CAAA,IAGKA,CAAcC,MACzB,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,KAAA,CAAA,CACE,SAAA,CAAA,+HAEA,CAAA,KAAA,CAAA,CAAA,iCACA,CAAA,sFAGA,CAAA,CAAA,KAAA,CAAA,CAAA,0LAEA,CAAA,qDACA,CAAA,2KAIA,CAAA,CAAA,KAAA,CAAA,CAAA,+FAEA,CAAA,+CACA,CAAA,qIAIM,CACR,QAAA,CAAU,CACR,SACA,CAAA,KAAM,CACR,EACA,CAAA,IAAM,CACJ,QAAQ,CAAA,CACR,MAAA,CAAA,EAAU,CAAA,QACH,GACP,CAAA,KAAM,CAAA,2BAEC,GACP,CAAA,KAAM,CAAA,EACN,CAAA,IAAA,CAAQ,EAAA,CACR,MAAO,CAAA,EACP,CAAA,KAAO,GACP,CAAA,KAAA,CAAQ,SAEJ,CAAA,CAAA,KAAA,CAAA,oJAEJ,CAAU,CAAA,QACH,CAAA,EACP,CAAA,KAAO,GACP,CAAA,KAAO,CAAA,EACP,OAAQ,EAAA,CACR,MAAA,CAAQ,EAAA,CACR,OACA,EAAA,CAAA,GAAM,CAAA,EACN,CAAA,IAAM,CAAA,OACD,CACL,EAAA,CAAA,GAAM,CACR,EACA,qBAEI,CAAA,CAAA,KAAA,CAAA,CAAW,SAAA,CAAA,cAGX,CAAA,CAAA,IAAA,CAAA,CAAW,SAAA,CAAA,eAGf,CAAS,CACP,CAAA,cACS,CAAA,CAAA,KAAA,CAAA,2CAGA,CAAA,CAAA,KAEX,CACF,QACA,CAAA,CAAA,CAAA,CAAA,gBAGM,CAAA,CAAA,CAAA,IACA,SACA,CAAA,MAAA,CAAA,wBAGA,CAAA,QAAA,CAAA,UAEA,SACA,CAAA,KACA,CAAA,MACA,CAAA,cAES,SAEP,CAAA,CAAA,KAAA,CAAA,CAAA,6EACA,CAAA,2EAKJ,CAAA,CAAA,CAAA,CAAU,SACH,WAAU,CAAA,iBACN,SAEP,CAAA,CAAA,KAAA,CAAA,CAAA,2ZAMR,CAAA,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const InputStylesDefaults = {\n type: 'text',\n} as const;\n\nexport const InputStyles = tv({\n slots: {\n container:\n 'group/input grid items-center [--length:attr(data-length_type(<number>),0)] [grid-template-columns:minmax(0,1fr)_min-content]',\n sizer: [\n '[grid-column:1/-1] [grid-row:1]',\n 'font-display group-size-medium/input:text-body-s group-size-small/input:text-body-xs',\n ],\n input: [\n 'block w-full rounded-medium py-xs pr-[calc(var(--room)+var(--spacing-s))] pl-s font-display text-default-light outline outline-interactive',\n 'enabled:group-focus/input:outline-highlight',\n 'enabled:group-hover/input:outline-interactive-hover',\n 'enabled:group-invalid/input:outline-serious',\n 'disabled:cursor-not-allowed disabled:text-disabled disabled:outline-interactive-disabled disabled:placeholder:text-disabled',\n ],\n clear: [\n '[grid-column:2/-1] [grid-row:1]',\n 'group-size-medium/input:mr-xs group-size-small/input:mr-xxs',\n 'enabled:fg-interactive enabled:bg-transparent',\n 'enabled:focus:fg-interactive-hover enabled:focus:bg-transparent',\n 'enabled:hover:fg-interactive-hover enabled:hover:bg-transparent',\n ],\n },\n variants: {\n autoSize: {\n false: '',\n true: '',\n },\n type: {\n button: '',\n checkbox: '',\n color: '',\n date: '',\n 'datetime-local': '',\n email: '',\n file: '',\n hidden: '',\n image: '',\n month: '',\n number: {\n input:\n '[appearance:textfield] placeholder:text-default-dark [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none',\n },\n password: '',\n radio: '',\n range: '',\n reset: '',\n search: '',\n submit: '',\n tel: '',\n text: '',\n time: '',\n url: '',\n week: '',\n },\n isClearable: {\n false: {\n container: '[--room:0px]',\n },\n true: {\n container: '[--room:20px]',\n },\n },\n isEmpty: {\n false: {\n clear: 'group-not-focus-within/input:hidden',\n },\n true: {\n clear: 'hidden',\n },\n },\n },\n compoundVariants: [\n {\n type: [\n 'color',\n 'date',\n 'datetime-local',\n 'email',\n 'number',\n 'password',\n 'search',\n 'tel',\n 'text',\n 'time',\n 'url',\n ],\n className: {\n sizer: [\n 'group-size-medium/input:min-w-[160px] group-size-medium/input:max-w-[400px]',\n 'group-size-medium/input:min-w-[80px] group-size-small/input:max-w-[200px]',\n ],\n },\n },\n {\n autoSize: true,\n type: ['number', 'text'],\n className: {\n sizer: [\n 'group-size-medium/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-s-spacing))+(var(--spacing-s)*2)+var(--room))]',\n 'group-size-small/input:w-[calc((var(--length)*1ch)+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))] group-size-small/input:min-w-[calc(2ch+((var(--length)-1)*var(--typography-body-xs-spacing))+(var(--spacing-s)*2)+var(--room))]',\n ],\n },\n },\n ],\n defaultVariants: InputStylesDefaults,\n});\n"]}
|
@@ -4,6 +4,7 @@ import { VariantProps } from 'tailwind-variants';
|
|
4
4
|
import { ButtonProps } from '../button/types.js';
|
5
5
|
import { InputStyles } from './styles.js';
|
6
6
|
import '../button/styles.js';
|
7
|
+
import 'tailwind-merge';
|
7
8
|
|
8
9
|
type InputProps = Omit<InputProps$1, 'className' | 'size' | 'type'> & RefAttributes<HTMLInputElement> & Omit<VariantProps<typeof InputStyles>, 'isEmpty'> & {
|
9
10
|
classNames?: {
|
@@ -1,10 +1,11 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as react from 'react';
|
3
|
+
import { ProviderProps } from '../../lib/types.js';
|
3
4
|
import { ContextValue } from 'react-aria-components';
|
4
|
-
import { LabelProps
|
5
|
+
import { LabelProps } from './types.js';
|
5
6
|
|
6
7
|
declare const LabelContext: react.Context<ContextValue<LabelProps, HTMLLabelElement>>;
|
7
|
-
declare function LabelProvider({ children, ...props }:
|
8
|
+
declare function LabelProvider({ children, ...props }: ProviderProps<LabelProps>): react_jsx_runtime.JSX.Element;
|
8
9
|
declare namespace LabelProvider {
|
9
10
|
var displayName: string;
|
10
11
|
}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {createContext}from'react';import {useContextProps,Label}from'react-aria-components';import {LabelStyles}from'./styles.js';
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,Label}from'react-aria-components';import {LabelStyles}from'./styles.js';const o=createContext(null);function t({children:r,...e}){return jsx(o.Provider,{value:e,children:r})}t.displayName="Label.Provider";function a({ref:r,...e}){[e,r]=useContextProps(e,r??null,o);const{children:i,className:s,isDisabled:n,isRequired:l,...p}=e;return jsxs(Label,{...p,className:LabelStyles({className:s}),"data-disabled":n||null,"data-required":l||null,children:[i,!l&&" (optional)"]})}a.displayName="Label",a.Provider=t;export{a as Label,o as LabelContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/label/index.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/label/index.tsx"],"names":["createContext","b","props","u","LabelProvider","ref","useContextProps","rest","P","d","m","isRequired","Label"],"mappings":"+LAyBEA,MAA0D,CAAA,CAAAC,aAAA,CAAI,IAEhE,EAAA,SAAyB,CAAA,CAAA,CAAA,QAAU,CAAA,CAAGC,CAAM,GAC1C,CAAA,CAAA,CAAA,CAAA,OACgBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE1C,CACAC,CAAAA,CAAc,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,gBAErB,CAAA,SAAiB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACpC,CAACA,CAAAA,CAAOG,CAAG,CAAA,CAAIC,CAAAA,CAAgBJ,EAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,CAAA,CAAA,CAAA,CAAA,cAAkB,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,UAAY,CAAA,CAAA,CAAA,UAAY,CAAA,CAAGE,CAAK,GAAIL,CAEjE,CAAA,CAAA,CAAA,CAAA,OACGM,IACE,CAAAC,KAAA,CAAGF,CAAAA,GACJ,CAAA,CAAA,SAAyB,CAAAG,WAAA,CAAA,CAAA,SAAW,CACpC,CAAA,CAAA,CAAA,CAAA,eAA6B,CAAA,CAAA,EAAA,IAC7B,CAAA,eAA6B,CAAA,CAAA,EAAA,IAE5B,CAAA,QACA,CAACC,CAAAA,CAAAA,CAAc,CAAA,CAAA,EAAA,aAItBC,CAAAA,CAAM,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,OACd,CAAA,CAAA,CAAA,QAAWR,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport type { ProviderProps } from '@/lib/types';\nimport { createContext } from 'react';\nimport {\n Label as AriaLabel,\n type ContextValue,\n useContextProps,\n} from 'react-aria-components';\nimport { LabelStyles } from './styles';\nimport type { LabelProps } from './types';\n\nexport const LabelContext =\n createContext<ContextValue<LabelProps, HTMLLabelElement>>(null);\n\nfunction LabelProvider({ children, ...props }: ProviderProps<LabelProps>) {\n return (\n <LabelContext.Provider value={props}>{children}</LabelContext.Provider>\n );\n}\nLabelProvider.displayName = 'Label.Provider';\n\nexport function Label({ ref, ...props }: LabelProps) {\n [props, ref] = useContextProps(props, ref ?? null, LabelContext);\n\n const { children, className, isDisabled, isRequired, ...rest } = props;\n\n return (\n <AriaLabel\n {...rest}\n className={LabelStyles({ className })}\n data-disabled={isDisabled || null}\n data-required={isRequired || null}\n >\n {children}\n {!isRequired && ' (optional)'}\n </AriaLabel>\n );\n}\nLabel.displayName = 'Label';\nLabel.Provider = LabelProvider;\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
1
|
+
import {tv}from'./../../lib/utils.js';const t=tv({base:["group/label text-header-s","enabled:fg-default-light","disabled:fg-disabled"]});export{t as LabelStyles};//# sourceMappingURL=styles.js.map
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/label/styles.ts"],"names":["e"],"mappings":"sCAeE,
|
1
|
+
{"version":3,"sources":["../../../src/components/label/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAM,CACJ,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,CAAA,2BACA,CAAA,0BACA,CAAA,sBAEH,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\n\nexport const LabelStyles = tv({\n base: [\n 'group/label text-header-s',\n 'enabled:fg-default-light',\n 'disabled:fg-disabled',\n ],\n});\n"]}
|
@@ -1,10 +1,9 @@
|
|
1
|
-
import { RefAttributes
|
1
|
+
import { RefAttributes } from 'react';
|
2
2
|
import { LabelProps as LabelProps$1 } from 'react-aria-components';
|
3
3
|
|
4
4
|
type LabelProps = LabelProps$1 & RefAttributes<HTMLLabelElement> & {
|
5
5
|
isDisabled?: boolean;
|
6
6
|
isRequired?: boolean;
|
7
7
|
};
|
8
|
-
type LabelProviderProps = PropsWithChildren<LabelProps>;
|
9
8
|
|
10
|
-
export type { LabelProps
|
9
|
+
export type { LabelProps };
|
@@ -8,26 +8,6 @@ import './styles.js';
|
|
8
8
|
import 'tailwind-variants';
|
9
9
|
|
10
10
|
declare const MenuContext: react.Context<ContextValue<MenuProps<unknown>, HTMLDivElement>>;
|
11
|
-
declare function Menu<T extends object>({ ref, ...props }: MenuProps<T>): react_jsx_runtime.JSX.Element;
|
12
|
-
declare namespace Menu {
|
13
|
-
var displayName: string;
|
14
|
-
var Trigger: typeof MenuTrigger;
|
15
|
-
var Submenu: (props: react_aria_components.SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
16
|
-
var Item: {
|
17
|
-
(props: MenuItemProps): react_jsx_runtime.JSX.Element;
|
18
|
-
displayName: string;
|
19
|
-
Label: typeof MenuLabel;
|
20
|
-
Description: typeof MenuDescription;
|
21
|
-
};
|
22
|
-
var Separator: typeof MenuSeparator;
|
23
|
-
var Section: typeof MenuSection;
|
24
|
-
}
|
25
|
-
declare const MenuItem: {
|
26
|
-
(props: MenuItemProps): react_jsx_runtime.JSX.Element;
|
27
|
-
displayName: string;
|
28
|
-
Label: typeof MenuLabel;
|
29
|
-
Description: typeof MenuDescription;
|
30
|
-
};
|
31
11
|
declare function MenuSection<T extends object>(props: MenuSectionProps<T>): react_jsx_runtime.JSX.Element;
|
32
12
|
declare namespace MenuSection {
|
33
13
|
var displayName: string;
|
@@ -44,5 +24,20 @@ declare function MenuDescription(props: MenuTextProps): react_jsx_runtime.JSX.El
|
|
44
24
|
declare namespace MenuDescription {
|
45
25
|
var displayName: string;
|
46
26
|
}
|
27
|
+
declare function MenuItem(props: MenuItemProps): react_jsx_runtime.JSX.Element;
|
28
|
+
declare namespace MenuItem {
|
29
|
+
var displayName: string;
|
30
|
+
var Label: typeof MenuLabel;
|
31
|
+
var Description: typeof MenuDescription;
|
32
|
+
}
|
33
|
+
declare function Menu<T extends object>({ ref, ...props }: MenuProps<T>): react_jsx_runtime.JSX.Element;
|
34
|
+
declare namespace Menu {
|
35
|
+
var displayName: string;
|
36
|
+
var Trigger: typeof MenuTrigger;
|
37
|
+
var Submenu: (props: react_aria_components.SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
38
|
+
var Item: typeof MenuItem;
|
39
|
+
var Separator: typeof MenuSeparator;
|
40
|
+
var Section: typeof MenuSection;
|
41
|
+
}
|
47
42
|
|
48
|
-
export { Menu, MenuContext
|
43
|
+
export { Menu, MenuContext };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import y from'@accelint/icons/chevron-right';import {createContext,useContext}from'react';import {
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {isSlottedContextValue}from'./../../lib/utils.js';import y from'@accelint/icons/chevron-right';import {createContext,useContext}from'react';import {useContextProps,Popover,Menu,composeRenderProps,MenuTrigger,SubmenuTrigger,MenuSection,Header,Collection,Separator,Text,MenuItem,Provider,KeyboardContext,DEFAULT_SLOT}from'react-aria-components';import {IconContext,Icon}from'../icon/index.js';import {MenuStyles,MenuStylesDefaults}from'./styles.js';const {menu:z,icon:B,item:G,label:J,description:Q,more:W,sectionHeader:X,separator:Y,keyboard:Z}=MenuStyles(),N=createContext(null);function P(n){const{header:e,children:o,classNames:t,items:i,...c}=n;return jsxs(MenuSection,{className:t?.section,...c,children:[jsx(Header,{className:X({className:t?.sectionHeader}),children:e}),jsx(Collection,{items:i,children:o})]})}P.displayName="Menu.Section";function S({className:n,...e}){return jsx(Separator,{...e,className:Y({className:n})})}S.displayName="Menu.Separator";function T(n){const{children:e,className:o,...t}=n;return jsx(Text,{...t,slot:"label",className:J({className:o}),children:e})}T.displayName="Menu.Item.Label";function f(n){const{children:e,className:o,...t}=n;return jsx(Text,{...t,slot:"description",className:Q({className:o}),children:e})}f.displayName="Menu.Item.Description";function u(n){const e=useContext(N),o=(isSlottedContextValue(e)?void 0:e?.variant)??MenuStylesDefaults.variant,{classNames:t,color:i=MenuStylesDefaults.color,children:c,...l}=n;return jsx(MenuItem,{...l,className:composeRenderProps(t?.item,r=>G({className:r,variant:o,color:i})),children:composeRenderProps(c,(r,{hasSubmenu:m})=>jsxs(Provider,{values:[[KeyboardContext,{className:Z({className:t?.keyboard})}],[IconContext,{slots:{[DEFAULT_SLOT]:{className:B({className:t?.icon})},submenu:{className:W({className:t?.more})}}}]],children:[typeof r=="string"?jsx(Text,{className:t?.text,slot:"label",children:r}):r,m&&jsx(Icon,{slot:"submenu",children:jsx(y,{})})]}))})}u.displayName="Menu.Item",u.Label=T,u.Description=f;function s({ref:n,...e}){[e,n]=useContextProps(e,n??null,N);const{children:o,className:t,selectionMode:i="single",offset:c=-4,placement:l,isNonModal:r,containerPadding:m,variant:x=MenuStylesDefaults.variant,...b}=e;return jsx(Popover,{offset:c,placement:l,isNonModal:r,containerPadding:m,children:jsx(N.Provider,{value:{variant:x},children:jsx(Menu,{ref:n,className:composeRenderProps(t,g=>z({className:g,variant:x})),selectionMode:i,...b,children:o})})})}s.displayName="Menu",s.Trigger=MenuTrigger,s.Submenu=SubmenuTrigger,s.Item=u,s.Separator=S,s.Section=P;export{s as Menu,N as MenuContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["icon","item","label","more","keyboard","MenuContext","createContext","q","C","Menu","props","useContextProps","ref","O","children","offset","variant","M","jsx","Popover","o","F","D","menu","p","context","useContext","isSlottedContextValue","v","color","MenuStylesDefaults","AriaMenuItem","rest","L","className","composeRenderProps","A","K","KeyboardContext","w","_","DEFAULT_SLOT","j","x","hasSubmenu","Icon","U","MenuItem","MenuSection","header","items","jsxs","AriaMenuSection","k","h","MenuSeparator","AriaSeparator","E","MenuLabel","AriaText","MenuDescription","AriaMenuTrigger","V","AriaSubmenuTrigger"],"mappings":"mgBAgDE,IAAA,CAAA,IAAAA,CACA,CAAA,CAAA,IAAAC,CACA,CAAA,CAAA,IAAAC,CAAAA,CACA,CAAA,KAAA,CAAA,CAAA,CAAA,WACAC,CACA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,aACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAAC,QAGWC,CACXC,CAAAA,CAAgE,CAAAC,UAAA,EAAI,CAAA,CAE/D,CAAAC,aAAA,CAAA,IAAA,EAASC,SAA8B,CAAA,CAAA,CAAGC,GAAuB,CACtE,CAACA,CAAAA,GAAU,CAAIC,CAAAA,CAAgBD,CAAAA,CAAOE,CAAAA,CAAAA,CAAO,CAAA,CAAAC,eAAA,CAAA,CAAMR,CAAW,CAAA,EAE9D,IACE,CAAA,CAAA,CAAA,CAAA,GAAA,CAAAS,QACA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,aAAgB,CAAA,CAAA,CAChB,QAAAC,CAAS,MACT,CAAA,CAAA,CAAA,EAAA,CAAA,SACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,gBACA,CAAA,CAAAC,CAAAA,OAA6B,CAAA,CAAA,CAAAC,kBAC7B,CAAA,OAGF,CAAA,GAAA,CAAA,CAAA,CACEC,CAAAA,CAACC,OACCC,GAAA,CAAAC,OAAQN,CAAAA,CACR,MAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,UACA,CAAA,CAAA,CAAA,gBAEA,CAAA,CAAA,CAAAG,QAAa,CAAAE,GAAA,CAAA,CAAA,CAAZ,QAA8B,CAAA,CAAA,KAAA,CAAAJ,CAAQ,OACrC,CAAA,CAAA,CAAA,CAAAE,QACE,CAAKN,GAAA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,CAAA,CAAA,CAAA,CAAA,SACA,CAAA,CAAA,CAAA,CAAUC,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport ChevronRight from '@accelint/icons/chevron-right';\nimport { createContext, useContext } from 'react';\nimport {\n Header as AriaHeader,\n Menu as AriaMenu,\n Collection as AriaMenuCollection,\n MenuItem as AriaMenuItem,\n MenuSection as AriaMenuSection,\n MenuTrigger as AriaMenuTrigger,\n Separator as AriaSeparator,\n SubmenuTrigger as AriaSubmenuTrigger,\n Text as AriaText,\n type ContextValue,\n DEFAULT_SLOT,\n KeyboardContext,\n Popover,\n Provider,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon, IconContext } from '../icon';\nimport { MenuStyles, MenuStylesDefaults } from './styles';\nimport type {\n MenuItemProps,\n MenuProps,\n MenuSectionProps,\n MenuTextProps,\n SeparatorProps,\n} from './types';\n\nconst {\n menu,\n icon,\n item,\n label,\n description,\n more,\n sectionHeader,\n separator,\n keyboard,\n} = MenuStyles();\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps<unknown>, HTMLDivElement>>(null);\n\nexport function Menu<T extends object>({ ref, ...props }: MenuProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, MenuContext);\n\n const {\n children,\n className,\n selectionMode = 'single',\n offset = -4,\n placement,\n isNonModal,\n containerPadding,\n variant = MenuStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <Popover\n offset={offset}\n placement={placement}\n isNonModal={isNonModal}\n containerPadding={containerPadding}\n >\n <MenuContext.Provider value={{ variant }}>\n <AriaMenu\n ref={ref}\n className={composeRenderProps(className, (className) =>\n menu({ className, variant }),\n )}\n selectionMode={selectionMode}\n {...rest}\n >\n {children}\n </AriaMenu>\n </MenuContext.Provider>\n </Popover>\n );\n}\nMenu.displayName = 'Menu';\n\nexport const MenuItem = (props: MenuItemProps) => {\n const context = useContext(MenuContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n MenuStylesDefaults.variant;\n\n const {\n classNames,\n color = MenuStylesDefaults.color,\n children,\n ...rest\n } = props;\n\n return (\n <AriaMenuItem\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className, variant, color }),\n )}\n >\n {composeRenderProps(children, (children, { hasSubmenu }) => (\n <Provider\n values={[\n [\n KeyboardContext,\n { className: keyboard({ className: classNames?.keyboard }) },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: {\n className: icon({ className: classNames?.icon }),\n },\n submenu: { className: more({ className: classNames?.more }) },\n },\n },\n ],\n ]}\n >\n {typeof children === 'string' ? (\n <AriaText className={classNames?.text} slot='label'>\n {children}\n </AriaText>\n ) : (\n children\n )}\n {hasSubmenu && (\n <Icon slot='submenu'>\n <ChevronRight />\n </Icon>\n )}\n </Provider>\n ))}\n </AriaMenuItem>\n );\n};\nMenuItem.displayName = 'Menu.Item';\n\nexport function MenuSection<T extends object>(props: MenuSectionProps<T>) {\n const { header, children, classNames, items, ...rest } = props;\n\n return (\n <AriaMenuSection className={classNames?.section} {...rest}>\n <AriaHeader\n className={sectionHeader({ className: classNames?.sectionHeader })}\n >\n {header}\n </AriaHeader>\n <AriaMenuCollection items={items}>{children}</AriaMenuCollection>\n </AriaMenuSection>\n );\n}\nMenuSection.displayName = 'Menu.Section';\n\nexport function MenuSeparator({ className, ...rest }: SeparatorProps) {\n return <AriaSeparator {...rest} className={separator({ className })} />;\n}\nMenuSeparator.displayName = 'Menu.Separator';\n\nexport function MenuLabel(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText {...rest} slot='label' className={label({ className })}>\n {children}\n </AriaText>\n );\n}\nMenuLabel.displayName = 'Menu.Item.Label';\n\nexport function MenuDescription(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText\n {...rest}\n slot='description'\n data-slot='description'\n className={description({ className })}\n >\n {children}\n </AriaText>\n );\n}\nMenuDescription.displayName = 'Menu.Item.Description';\n\nMenu.Trigger = AriaMenuTrigger;\nMenu.Submenu = AriaSubmenuTrigger;\nMenu.Item = MenuItem;\nMenuItem.Label = MenuLabel;\nMenuItem.Description = MenuDescription;\nMenu.Separator = MenuSeparator;\nMenu.Section = MenuSection;\n"]}
|
1
|
+
{"version":3,"sources":["../../../src/components/menu/index.tsx"],"names":["label","description","sectionHeader","keyboard","MenuStyles","MenuSection","props","C","children","classNames","rest","jsxs","A","k","jsx","a","h","items","H","MenuSeparator","className","E","p","useContext","MenuContext","context","I","v","MenuStylesDefaults","d","L","item","M","variant","composeRenderProps","Provider","K","w","_","icon","j","more","AriaText","hasSubmenu","U","MenuItem","MenuDescription","Menu","ref","O","placement","isNonModal","offset","F","AriaMenu","menu","AriaSubmenuTrigger"],"mappings":"mgBAkDE,MAAA,CAAA,IAAAA,CACA,CAAA,CAAA,IAAA,CAAA,CAAA,CAAA,IAAAC,CACA,CAAA,CAAA,KACA,CAAA,CAAA,CAAA,WAAAC,CAAAA,CACA,CAAA,IAAA,CAAA,CAAA,CAAA,aACAC,CACF,CAAA,CAAIC,SAG8D,CAAA,CAAA,CAAI,QAEtE,CAAA,CAAA,CAASC,CAAAA,UAA8BC,EAA4B,CACjE,CAAA,CAAAC,aAAA,CAAA,IAAQ,EAAA,SAAQ,CAAA,CAAA,CAAA,CAAA,CAAAC,KAAU,CAAA,MAAA,CAAAC,CAAAA,CAAY,QAAO,CAAA,CAAA,CAAGC,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AAA,CAAYF,CAAAA,SACZ,CAAA,CAAA,CAAA,UAEA,CAAA,CAAA,CAAA,gBAAa,CAAZ,CAAqB,CAAA,QAAS,CAAApC,GAAA,CAAA,CAAA,CAAA,QAC7B,CAAA,CAAA,KAACuC,CAAAA,CAAA,OAEC,CAAA,CAAA,CAAA,CAAA,QAA8BlC,CAAAA,GAAYA,CAAAA,IAAAA,CACxCmC,CAAAA,GAAO,CAAA,CAAA,CAAA,SAAW,CAAAvB,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAQ,CAAC,CAC7B,CAAA,SACA,CAAA,CAAA,CAAA,OACC,CAAGtB,CAAAA,CAEH,CAAA,CAAA,CAAA,aAKX,CACAqC,CAAAA,CAAK,GAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CACnBA,CAAAA,CAAK,CAAA,CAAA,CAAA,WACA,CAAA,MAAUS,CACfT,CAAAA,CAAK,OACLA,CAAAA,WAAK,CAAA,CAAA,CAAA,OAAY5B,CAAAA,cACjB4B,EAAK,CAAA,IAAA,CAAA,CAAA,CAAU1C,CAAAA,CAAAA,SAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { isSlottedContextValue } from '@/lib/utils';\nimport ChevronRight from '@accelint/icons/chevron-right';\nimport { createContext, useContext } from 'react';\nimport {\n Header as AriaHeader,\n Menu as AriaMenu,\n Collection as AriaMenuCollection,\n MenuItem as AriaMenuItem,\n MenuSection as AriaMenuSection,\n MenuTrigger as AriaMenuTrigger,\n Separator as AriaSeparator,\n SubmenuTrigger as AriaSubmenuTrigger,\n Text as AriaText,\n type ContextValue,\n DEFAULT_SLOT,\n KeyboardContext,\n Popover,\n Provider,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon, IconContext } from '../icon';\nimport { MenuStyles, MenuStylesDefaults } from './styles';\nimport type {\n MenuItemProps,\n MenuProps,\n MenuSectionProps,\n MenuTextProps,\n SeparatorProps,\n} from './types';\n\nconst {\n menu,\n icon,\n item,\n label,\n description,\n more,\n sectionHeader,\n separator,\n keyboard,\n} = MenuStyles();\n\nexport const MenuContext =\n createContext<ContextValue<MenuProps<unknown>, HTMLDivElement>>(null);\n\nfunction MenuSection<T extends object>(props: MenuSectionProps<T>) {\n const { header, children, classNames, items, ...rest } = props;\n\n return (\n <AriaMenuSection className={classNames?.section} {...rest}>\n <AriaHeader\n className={sectionHeader({ className: classNames?.sectionHeader })}\n >\n {header}\n </AriaHeader>\n <AriaMenuCollection items={items}>{children}</AriaMenuCollection>\n </AriaMenuSection>\n );\n}\nMenuSection.displayName = 'Menu.Section';\n\nfunction MenuSeparator({ className, ...rest }: SeparatorProps) {\n return <AriaSeparator {...rest} className={separator({ className })} />;\n}\nMenuSeparator.displayName = 'Menu.Separator';\n\nfunction MenuLabel(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText {...rest} slot='label' className={label({ className })}>\n {children}\n </AriaText>\n );\n}\nMenuLabel.displayName = 'Menu.Item.Label';\n\nfunction MenuDescription(props: MenuTextProps) {\n const { children, className, ...rest } = props;\n\n return (\n <AriaText\n {...rest}\n slot='description'\n className={description({ className })}\n >\n {children}\n </AriaText>\n );\n}\nMenuDescription.displayName = 'Menu.Item.Description';\n\nfunction MenuItem(props: MenuItemProps) {\n const context = useContext(MenuContext);\n const variant =\n (isSlottedContextValue(context) ? undefined : context?.variant) ??\n MenuStylesDefaults.variant;\n\n const {\n classNames,\n color = MenuStylesDefaults.color,\n children,\n ...rest\n } = props;\n\n return (\n <AriaMenuItem\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className, variant, color }),\n )}\n >\n {composeRenderProps(children, (children, { hasSubmenu }) => (\n <Provider\n values={[\n [\n KeyboardContext,\n { className: keyboard({ className: classNames?.keyboard }) },\n ],\n [\n IconContext,\n {\n slots: {\n [DEFAULT_SLOT]: {\n className: icon({ className: classNames?.icon }),\n },\n submenu: { className: more({ className: classNames?.more }) },\n },\n },\n ],\n ]}\n >\n {typeof children === 'string' ? (\n <AriaText className={classNames?.text} slot='label'>\n {children}\n </AriaText>\n ) : (\n children\n )}\n {hasSubmenu && (\n <Icon slot='submenu'>\n <ChevronRight />\n </Icon>\n )}\n </Provider>\n ))}\n </AriaMenuItem>\n );\n}\nMenuItem.displayName = 'Menu.Item';\nMenuItem.Label = MenuLabel;\nMenuItem.Description = MenuDescription;\n\nexport function Menu<T extends object>({ ref, ...props }: MenuProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, MenuContext);\n\n const {\n children,\n className,\n selectionMode = 'single',\n offset = -4,\n placement,\n isNonModal,\n containerPadding,\n variant = MenuStylesDefaults.variant,\n ...rest\n } = props;\n\n return (\n <Popover\n offset={offset}\n placement={placement}\n isNonModal={isNonModal}\n containerPadding={containerPadding}\n >\n <MenuContext.Provider value={{ variant }}>\n <AriaMenu\n ref={ref}\n className={composeRenderProps(className, (className) =>\n menu({ className, variant }),\n )}\n selectionMode={selectionMode}\n {...rest}\n >\n {children}\n </AriaMenu>\n </MenuContext.Provider>\n </Popover>\n );\n}\nMenu.displayName = 'Menu';\nMenu.Trigger = AriaMenuTrigger;\nMenu.Submenu = AriaSubmenuTrigger;\nMenu.Item = MenuItem;\nMenu.Separator = MenuSeparator;\nMenu.Section = MenuSection;\n"]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import {tv}from'./../../lib/utils.js';
|
1
|
+
import {tv}from'./../../lib/utils.js';const t={variant:"cozy",color:"info"},o=tv({slots:{menu:"group/menu mt-s overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",icon:"[grid-area:icon]",item:["group/menu-item flex items-center gap-x-s px-s text-body-s",'grid grid-cols-[auto_auto_1fr_auto] [grid-template-areas:"icon_label_space_action"_"icon_description_space_action"]',"disabled:fg-disabled disabled:bg-transparent"],label:"truncate [grid-area:label] group-not-has-[>_[slot=description]]/menu-item:row-span-full",description:"fg-default-dark group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light group-disabled/menu-item:fg-disabled truncate text-body-xs [grid-area:description]",more:"[grid-area:action]",sectionHeader:"fg-default-dark px-s py-xs text-header-xs",separator:"mx-3 my-1 border border-static-light",keyboard:"[grid-area:action]"},variants:{variant:{cozy:{item:"pt-s pb-s"},compact:{item:"pt-xs pb-xs"}},color:{info:{item:["fg-default-light hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light","selected:bg-highlight-bold open:bg-highlight-bold hover:bg-highlight-bold focus:bg-highlight-bold"]},serious:{item:["fg-serious hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light","selected:bg-serious-bold open:bg-serious-bold hover:bg-serious-bold focus:bg-serious-bold"]}}},defaultVariants:t});export{o as MenuStyles,t as MenuStylesDefaults};//# sourceMappingURL=styles.js.map
|
2
2
|
//# sourceMappingURL=styles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["e"],"mappings":"sCAiBE,
|
1
|
+
{"version":3,"sources":["../../../src/components/menu/styles.ts"],"names":["MenuStyles","tv","e"],"mappings":"sCAiBE,MAAA,CAAS,CAAA,CAAA,OACT,CAAA,MAAO,CAAA,KAGIA,CAAaC,MACxB,CAAA,CAAA,CAAO,CACLC,EAAA,CAAA,CAAA,KAAM,CAAA,CAAA,IAAA,CAAA,yIACA,CAAA,IAAA,CAAA,kBAEJ,CAAA,IAAA,CAAA,CAAA,4DACA,CAAA,qHACA,CAAA,8CAGA,CAAA,CAAA,KAAA,CAAA,yFACF,CAAA,WACE,CAAA,kLACI,CAAA,IAAA,CAAA,oBACN,CAAA,aAAe,CAAA,2CACf,CAAW,gDACD,CAAA,QAAA,CAAA,oBAEZ,CAAU,CACR,QAAS,CACP,CAAA,aACQ,CAAA,CAAA,IAAA,CAAA,WAEC,CACP,QAAM,CAAA,CAAA,IAAA,CAAA,aAIR,CAAA,CAAA,CAAA,KACE,CAAA,CAAA,4HAEE,CAAA,mGAGJ,CAAS,CACP,CAAA,OACE,CAAA,CAAA,IAAA,CAAA,CAAA,0GACA,CAAA,2FAKR,CAAA,CAAA,CAAA,CAAA,CAAA,eACD,CAAA,CAAA,CAAA","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from '@/lib/utils';\nimport type { ReactNode } from 'react';\nimport type { VariantProps } from 'tailwind-variants';\n\nexport const MenuStylesDefaults = {\n variant: 'cozy',\n color: 'info',\n} as const;\n\nexport const MenuStyles = tv({\n slots: {\n menu: 'group/menu mt-s overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light',\n icon: '[grid-area:icon]',\n item: [\n 'group/menu-item flex items-center gap-x-s px-s text-body-s',\n 'grid grid-cols-[auto_auto_1fr_auto] [grid-template-areas:\"icon_label_space_action\"_\"icon_description_space_action\"]',\n 'disabled:fg-disabled disabled:bg-transparent',\n ],\n label:\n 'truncate [grid-area:label] group-not-has-[>_[slot=description]]/menu-item:row-span-full',\n description:\n 'fg-default-dark group-hover/menu-item:fg-inverse-light group-focus/menu-item:fg-inverse-light group-disabled/menu-item:fg-disabled truncate text-body-xs [grid-area:description]',\n more: '[grid-area:action]',\n sectionHeader: 'fg-default-dark px-s py-xs text-header-xs',\n separator: 'mx-3 my-1 border border-static-light',\n keyboard: '[grid-area:action]',\n },\n variants: {\n variant: {\n cozy: {\n item: 'pt-s pb-s',\n },\n compact: {\n item: 'pt-xs pb-xs',\n },\n },\n color: {\n info: {\n item: [\n 'fg-default-light hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light',\n 'selected:bg-highlight-bold open:bg-highlight-bold hover:bg-highlight-bold focus:bg-highlight-bold',\n ],\n },\n serious: {\n item: [\n 'fg-serious hover:fg-inverse-light focus:fg-inverse-light open:fg-inverse-light selected:fg-inverse-light',\n 'selected:bg-serious-bold open:bg-serious-bold hover:bg-serious-bold focus:bg-serious-bold',\n ],\n },\n },\n },\n defaultVariants: MenuStylesDefaults,\n});\n\nexport type MenuStyleVariants = VariantProps<typeof MenuStyles> & {\n prefixIcon?: ReactNode;\n};\n"]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import * as react from 'react';
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
3
|
+
import { NavigationStackProps, NavigationStackViewProps, NavigationStackNavigateProps } from './types.js';
|
4
|
+
import '@react-types/shared';
|
5
|
+
import 'type-fest';
|
6
|
+
|
7
|
+
declare const NavigationStack: {
|
8
|
+
({ children, defaultViewId, }: NavigationStackProps): react_jsx_runtime.JSX.Element;
|
9
|
+
displayName: string;
|
10
|
+
View: {
|
11
|
+
({ id, children }: NavigationStackViewProps): react.ReactNode;
|
12
|
+
displayName: string;
|
13
|
+
};
|
14
|
+
Navigate: {
|
15
|
+
({ children, for: action, ...props }: NavigationStackNavigateProps): react_jsx_runtime.JSX.Element;
|
16
|
+
displayName: string;
|
17
|
+
};
|
18
|
+
};
|
19
|
+
|
20
|
+
export { NavigationStack };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext,useState,useCallback,useMemo,useContext}from'react';import {PressResponder}from'@react-aria/interactions';import {Pressable}from'react-aria-components';const c=createContext({currentViewId:null,pushView:()=>{},popView:()=>{},clear:()=>{},canGoBack:false,viewStack:[]}),u=({id:i,children:t})=>useContext(c).currentViewId===i?t:null;u.displayName="NavigationStack.View";const S=({children:i,for:t,...a})=>{const e=useContext(c),o=useCallback(()=>{t==="back"?e.popView():t==="clear"?e.clear():e.pushView(t);},[t,e.popView,e.clear,e.pushView]);return jsx(PressResponder,{onPress:o,children:jsx(Pressable,{...a,children:i})})};S.displayName="NavigationStack.Navigate";const r=({children:i,defaultViewId:t})=>{const[a,e]=useState(t?[t]:[]),o=a[a.length-1]||null,v=a.length>1,l=useCallback(s=>{e(w=>[...w,s]);},[]),g=useCallback(()=>{e(s=>s.slice(0,-1));},[]),N=useCallback(()=>{e(t?[t]:[]);},[t]),V=useMemo(()=>({currentViewId:o,pushView:l,popView:g,clear:N,canGoBack:v,viewStack:a}),[o,v,a,l,g,N]);return jsx(c.Provider,{value:V,children:i})};r.displayName="NavigationStack",r.View=u,r.Navigate=S;export{r as NavigationStack};//# sourceMappingURL=index.js.map
|
2
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/navigation-stack/index.tsx"],"names":["NavigationStackContext","createContext","NavigationStackView","id","children","useContext","NavigationStackNavigate","action","props","context","handleOnPress","useCallback","jsx","PressResponder","Pressable","NavigationStack","defaultViewId","viewStack","setViewStack","useState","currentViewId","canGoBack","pushView","viewId","prev","popView","clear","contextValue","useMemo"],"mappings":"sOA+BA,MAAMA,CAAAA,CAAyBC,aAAAA,CAA2C,CACxE,aAAA,CAAe,IAAA,CACf,QAAA,CAAU,IAAG,CAAA,CAAA,CACb,OAAA,C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galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\nimport 'client-only';\nimport {\n createContext,\n useCallback,\n useContext,\n useMemo,\n useState,\n} from 'react';\n\nimport { PressResponder } from '@react-aria/interactions';\nimport { Pressable } from 'react-aria-components';\nimport type {\n NavigationStackContextValue,\n NavigationStackNavigateProps,\n NavigationStackProps,\n NavigationStackViewProps,\n} from './types';\n\nconst NavigationStackContext = createContext<NavigationStackContextValue>({\n currentViewId: null,\n pushView: () => undefined,\n popView: () => undefined,\n clear: () => undefined,\n canGoBack: false,\n viewStack: [],\n});\n\nconst NavigationStackView = ({ id, children }: NavigationStackViewProps) => {\n const context = useContext(NavigationStackContext);\n const isActive = context.currentViewId === id;\n\n return isActive ? children : null;\n};\nNavigationStackView.displayName = 'NavigationStack.View';\n\nconst NavigationStackNavigate = ({\n children,\n for: action,\n ...props\n}: NavigationStackNavigateProps) => {\n const context = useContext(NavigationStackContext);\n const handleOnPress = useCallback(() => {\n if (action === 'back') {\n context.popView();\n } else if (action === 'clear') {\n context.clear();\n } else {\n context.pushView(action);\n }\n }, [action, context.popView, context.clear, context.pushView]);\n return (\n <PressResponder onPress={handleOnPress}>\n <Pressable {...props}>{children}</Pressable>\n </PressResponder>\n );\n};\nNavigationStackNavigate.displayName = 'NavigationStack.Navigate';\n\nexport const NavigationStack = ({\n children,\n defaultViewId,\n}: NavigationStackProps) => {\n const [viewStack, setViewStack] = useState<string[]>(\n defaultViewId ? [defaultViewId] : [],\n );\n const currentViewId = viewStack[viewStack.length - 1] || null;\n const canGoBack = viewStack.length > 1;\n\n const pushView = useCallback((viewId: string) => {\n setViewStack((prev) => [...prev, viewId]);\n }, []);\n const popView = useCallback(() => {\n setViewStack((prev) => prev.slice(0, -1));\n }, []);\n const clear = useCallback(() => {\n setViewStack(defaultViewId ? [defaultViewId] : []);\n }, [defaultViewId]);\n\n const contextValue = useMemo(\n () => ({\n currentViewId,\n pushView,\n popView,\n clear,\n canGoBack,\n viewStack,\n }),\n [currentViewId, canGoBack, viewStack, pushView, popView, clear],\n );\n\n return (\n <NavigationStackContext.Provider value={contextValue}>\n {children}\n </NavigationStackContext.Provider>\n );\n};\nNavigationStack.displayName = 'NavigationStack';\nNavigationStack.View = NavigationStackView;\nNavigationStack.Navigate = NavigationStackNavigate;\n"]}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { FocusableElement } from '@react-types/shared';
|
2
|
+
import { RefAttributes, ReactNode, ReactElement, DOMAttributes, Key } from 'react';
|
3
|
+
import { LiteralUnion } from 'type-fest';
|
4
|
+
|
5
|
+
type NavigationStackProps = RefAttributes<HTMLDivElement> & {
|
6
|
+
children?: ReactNode;
|
7
|
+
defaultViewId?: string;
|
8
|
+
className?: string;
|
9
|
+
};
|
10
|
+
type NavigationStackViewProps = RefAttributes<HTMLDivElement> & {
|
11
|
+
id: string;
|
12
|
+
children: ReactNode;
|
13
|
+
};
|
14
|
+
type NavigationStackNavigateProps = {
|
15
|
+
children: ReactElement<DOMAttributes<FocusableElement>, string>;
|
16
|
+
/**
|
17
|
+
* The string is to be used as a childId. When for is a childId
|
18
|
+
* navigate will push the childId onto the stack.
|
19
|
+
* */
|
20
|
+
for: LiteralUnion<'back' | 'clear', string>;
|
21
|
+
};
|
22
|
+
type NavigationStackContextValue = {
|
23
|
+
currentViewId: Key | null;
|
24
|
+
pushView: (viewId: string) => void;
|
25
|
+
popView: () => void;
|
26
|
+
clear: () => void;
|
27
|
+
canGoBack: boolean;
|
28
|
+
viewStack: string[];
|
29
|
+
};
|
30
|
+
|
31
|
+
export type { NavigationStackContextValue, NavigationStackNavigateProps, NavigationStackProps, NavigationStackViewProps };
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
@@ -1,32 +1,38 @@
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
2
2
|
import * as react from 'react';
|
3
|
-
import {
|
4
|
-
import {
|
5
|
-
import '
|
6
|
-
import 'cva';
|
3
|
+
import { ContextValue } from 'react-aria-components';
|
4
|
+
import { OptionsDataItem, OptionsProps, OptionsItemProps, OptionsItemTextProps, OptionsSectionProps } from './types.js';
|
5
|
+
import '../icon/types.js';
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
label?: string;
|
13
|
-
placeholder?: string;
|
14
|
-
size?: OptionsItemProps<T>['size'];
|
15
|
-
type?: OptionsItemProps<T>['type'];
|
7
|
+
declare const OptionsContext: react.Context<ContextValue<OptionsProps<OptionsDataItem>, HTMLDivElement>>;
|
8
|
+
declare function OptionsSection<T extends OptionsDataItem>({ children, classNames, header, items, }: OptionsSectionProps<T>): react_jsx_runtime.JSX.Element;
|
9
|
+
declare namespace OptionsSection {
|
10
|
+
var displayName: string;
|
16
11
|
}
|
17
|
-
declare
|
18
|
-
declare
|
19
|
-
declare namespace Options {
|
12
|
+
declare function OptionsItemContent({ className, ...rest }: OptionsItemTextProps): react_jsx_runtime.JSX.Element;
|
13
|
+
declare namespace OptionsItemContent {
|
20
14
|
var displayName: string;
|
21
|
-
var Item: typeof OptionsItem;
|
22
|
-
var Section: typeof OptionsSection;
|
23
15
|
}
|
24
|
-
|
25
|
-
|
16
|
+
declare function OptionsItemLabel({ className, ...rest }: OptionsItemTextProps): react_jsx_runtime.JSX.Element;
|
17
|
+
declare namespace OptionsItemLabel {
|
18
|
+
var displayName: string;
|
26
19
|
}
|
27
|
-
declare function
|
28
|
-
declare namespace
|
20
|
+
declare function OptionsItemDescription({ className, ...rest }: OptionsItemTextProps): react_jsx_runtime.JSX.Element;
|
21
|
+
declare namespace OptionsItemDescription {
|
29
22
|
var displayName: string;
|
30
23
|
}
|
24
|
+
declare function OptionsItem<T extends OptionsDataItem>({ children, classNames, color, textValue, ...rest }: OptionsItemProps<T>): react_jsx_runtime.JSX.Element;
|
25
|
+
declare namespace OptionsItem {
|
26
|
+
var displayName: string;
|
27
|
+
var Label: typeof OptionsItemLabel;
|
28
|
+
var Content: typeof OptionsItemContent;
|
29
|
+
var Description: typeof OptionsItemDescription;
|
30
|
+
}
|
31
|
+
declare function Options<T extends OptionsDataItem>({ ref, ...props }: OptionsProps<T>): react_jsx_runtime.JSX.Element;
|
32
|
+
declare namespace Options {
|
33
|
+
var displayName: string;
|
34
|
+
var Item: typeof OptionsItem;
|
35
|
+
var Section: typeof OptionsSection;
|
36
|
+
}
|
31
37
|
|
32
|
-
export { Options, OptionsContext
|
38
|
+
export { Options, OptionsContext };
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import'client-only';import {createContext}from'react';import {ListBox,ListBoxSection,Header,Collection}from'react-aria-components';import {
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {useContextProps,ListBox,composeRenderProps,ListBoxSection,Header,Collection,Text,ListBoxItem}from'react-aria-components';import {Icon}from'../icon/index.js';import {OptionsStyles}from'./styles.js';const {list:S,section:b,header:B,item:v,content:z,icon:H,label:V,description:g}=OptionsStyles(),E=createContext(null);function O({children:t,classNames:e,header:n,items:i}){return jsxs(ListBoxSection,{id:n,className:b({className:e?.section}),children:[jsx(Header,{className:B({className:e?.header}),children:n}),jsx(Collection,{items:i,children:t})]})}O.displayName="Options.Section";function I({className:t,...e}){return jsx("div",{...e,className:z({className:t})})}I.displayName="Options.Item.Content";function r({className:t,...e}){return jsx(Text,{...e,slot:"label",className:V({className:t})})}r.displayName="Options.Item.Label";function x({className:t,...e}){return jsx(Text,{...e,slot:"description",className:g({className:t})})}x.displayName="Options.Item.Description";function p({children:t,classNames:e,color:n="info",textValue:i=typeof t=="string"?t:"",...a}){return jsx(ListBoxItem,{...a,className:composeRenderProps(e?.item,s=>v({className:s})),textValue:i,"data-color":n,children:composeRenderProps(t,s=>jsx(Icon.Provider,{className:H({className:e?.icon}),size:"small",children:typeof s=="string"?jsx(r,{children:s}):s}))})}p.displayName="Options.Item",p.Label=r,p.Content=I,p.Description=x;function l({ref:t,...e}){[e,t]=useContextProps(e,t??null,E);const{children:n,className:i,size:a,...s}=e;return jsx(ListBox,{...s,ref:t,className:composeRenderProps(i,d=>S({className:d})),"data-size":a,children:n})}l.displayName="Options",l.Item=p,l.Section=O;export{l as Options,E as OptionsContext};//# sourceMappingURL=index.js.map
|
2
2
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["
|
1
|
+
{"version":3,"sources":["../../../src/components/options/index.tsx"],"names":["item","label","description","D","u","classNames","ListBoxSection","M","y","section","jsx","Header","o","headerClassNames","items","N","className","c","T","textValue","color","children","m","OptionsItemLabel","OptionsItemContent","OptionsItem","OptionsItemDescription","props","useContextProps","ref","OptionsContext","C","ListBox","f","composeRenderProps","size","Options","OptionsSection"],"mappings":"4SAsCE,MAAA,CAAA,IACA,CAAA,CAAA,CAAA,OACA,CAAA,CAAA,CAAAA,aAEA,CAAA,CAAA,CAAA,OACA,CAAA,CAAAC,CAAAA,IACA,CAAA,CAAA,CAAA,KAAA,CAAAC,CACF,YAII,CAAA,CACF,EAEFC,aAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAA,QAAAC,CAAAA,CACA,WACA,CAAA,CAAA,CAAA,MAEA,CAAA,CAAA,CAAA,KACGC,EAAA,CACC,CAAA,CAAA,OACAC,IAAA,CAAAC,cAAA,CAAA,CAAA,EAAWC,CAAQ,CAAE,CAAA,SAAWJ,CAAAA,CAAAA,CAAY,CAAA,SAE5C,CAAA,CAAA,EAAA,OAAAK,CAACC,EAAA,QAAO,CAAA,CAAAC,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,CAAAA,CACX,CAAA,CAAA,SAAA,CAAA,CAAYC,aAEQC,EAAWA,CAAAA,QACvB,CAAAC,kBAAA,CAAA,CAAA,CAAA,CAAA,EACJV,iBAAgB,CAAE,UAAWP,CAAAA,CAAAA,CAAY,CAAA,SACzC,CAAA,CAAK,QAEJ,CAAA,IAAA,CAAA,OAAA,CAAA,QAAoB,CAAA,OAClBkB,GAAkB,QAAA,CAAAF,IAAS,CAAA,CAE5BA,CAAAA,QAOA,YAAc,CAAA,CAAA,WAAA,CAAA,sBAEJG,CACtBC,CAAAA,CAAY,CAAA,CAAA,OAAA,CAAA,CAAA,CAAcC,CAAAA,CAEnB,WAA4C,CACjD,WAEF,CAAoB,CAClB,CAACC,GAAU,CAAA,CAAIC,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMC,CAAc,CAAAC,eAEjE,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAAf,CAAW,WAAc,CAAA,CAAIW,CAAAA,IAE/C,CAAA,CAAA,CAAA,GACGK,EAAA,CACE,CAAA,CAAA,OACIH,GAAAA,CACLI,iBAAWC,CAAmBlB,CAAAA,CAAYA,SACjC,CAAAM,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAC,CACpB,CAAA,aACWa,CAAAA,CAEV,WACH,CAEJ,CACAC,SAAQ,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACd,CAAA,SACA,CAAA,CAAA,CAAA,IAAUC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,OAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Collection,\n type ContextValue,\n Header,\n ListBox,\n ListBoxItem,\n ListBoxSection,\n Text,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { Icon } from '../icon';\nimport { OptionsStyles } from './styles';\nimport type {\n OptionsDataItem,\n OptionsItemProps,\n OptionsItemTextProps,\n OptionsProps,\n OptionsSectionProps,\n} from './types';\n\nconst {\n list,\n section,\n header: headerClassNames,\n item,\n content,\n icon,\n label,\n description,\n} = OptionsStyles();\n\nexport const OptionsContext =\n createContext<ContextValue<OptionsProps<OptionsDataItem>, HTMLDivElement>>(\n null,\n );\n\nfunction OptionsSection<T extends OptionsDataItem>({\n children,\n classNames,\n header,\n items,\n}: OptionsSectionProps<T>) {\n return (\n <ListBoxSection\n id={header}\n className={section({ className: classNames?.section })}\n >\n <Header className={headerClassNames({ className: classNames?.header })}>\n {header}\n </Header>\n <Collection items={items}>{children}</Collection>\n </ListBoxSection>\n );\n}\nOptionsSection.displayName = 'Options.Section';\n\nfunction OptionsItemContent({ className, ...rest }: OptionsItemTextProps) {\n return <div {...rest} className={content({ className })} />;\n}\nOptionsItemContent.displayName = 'Options.Item.Content';\n\nfunction OptionsItemLabel({ className, ...rest }: OptionsItemTextProps) {\n return <Text {...rest} slot='label' className={label({ className })} />;\n}\nOptionsItemLabel.displayName = 'Options.Item.Label';\n\nfunction OptionsItemDescription({ className, ...rest }: OptionsItemTextProps) {\n return (\n <Text {...rest} slot='description' className={description({ className })} />\n );\n}\nOptionsItemDescription.displayName = 'Options.Item.Description';\n\nfunction OptionsItem<T extends OptionsDataItem>({\n children,\n classNames,\n color = 'info',\n textValue = typeof children === 'string' ? children : '',\n ...rest\n}: OptionsItemProps<T>) {\n return (\n <ListBoxItem\n {...rest}\n className={composeRenderProps(classNames?.item, (className) =>\n item({ className }),\n )}\n textValue={textValue}\n data-color={color}\n >\n {composeRenderProps(children, (children) => (\n <Icon.Provider\n className={icon({ className: classNames?.icon })}\n size='small'\n >\n {typeof children === 'string' ? (\n <OptionsItemLabel>{children}</OptionsItemLabel>\n ) : (\n children\n )}\n </Icon.Provider>\n ))}\n </ListBoxItem>\n );\n}\nOptionsItem.displayName = 'Options.Item';\nOptionsItem.Label = OptionsItemLabel;\nOptionsItem.Content = OptionsItemContent;\nOptionsItem.Description = OptionsItemDescription;\n\nexport function Options<T extends OptionsDataItem>({\n ref,\n ...props\n}: OptionsProps<T>) {\n [props, ref] = useContextProps(props, ref ?? null, OptionsContext);\n\n const { children, className, size, ...rest } = props;\n\n return (\n <ListBox<T>\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n list({ className }),\n )}\n data-size={size}\n >\n {children}\n </ListBox>\n );\n}\nOptions.displayName = 'Options';\nOptions.Item = OptionsItem;\nOptions.Section = OptionsSection;\n"]}
|
@@ -0,0 +1,72 @@
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
2
|
+
import * as tailwind_merge from 'tailwind-merge';
|
3
|
+
|
4
|
+
declare const OptionsStyles: tailwind_variants.TVReturnType<{
|
5
|
+
[key: string]: {
|
6
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
7
|
+
icon?: tailwind_merge.ClassNameValue;
|
8
|
+
content?: tailwind_merge.ClassNameValue;
|
9
|
+
header?: tailwind_merge.ClassNameValue;
|
10
|
+
label?: tailwind_merge.ClassNameValue;
|
11
|
+
section?: tailwind_merge.ClassNameValue;
|
12
|
+
list?: tailwind_merge.ClassNameValue;
|
13
|
+
description?: tailwind_merge.ClassNameValue;
|
14
|
+
item?: tailwind_merge.ClassNameValue;
|
15
|
+
};
|
16
|
+
};
|
17
|
+
} | {
|
18
|
+
[x: string]: {
|
19
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
20
|
+
icon?: tailwind_merge.ClassNameValue;
|
21
|
+
content?: tailwind_merge.ClassNameValue;
|
22
|
+
header?: tailwind_merge.ClassNameValue;
|
23
|
+
label?: tailwind_merge.ClassNameValue;
|
24
|
+
section?: tailwind_merge.ClassNameValue;
|
25
|
+
list?: tailwind_merge.ClassNameValue;
|
26
|
+
description?: tailwind_merge.ClassNameValue;
|
27
|
+
item?: tailwind_merge.ClassNameValue;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
} | {}, {
|
31
|
+
list: string;
|
32
|
+
section: string;
|
33
|
+
header: string;
|
34
|
+
item: string[];
|
35
|
+
content: string;
|
36
|
+
icon: string[];
|
37
|
+
label: string[];
|
38
|
+
description: string[];
|
39
|
+
}, undefined, {
|
40
|
+
[key: string]: {
|
41
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
42
|
+
icon?: tailwind_merge.ClassNameValue;
|
43
|
+
content?: tailwind_merge.ClassNameValue;
|
44
|
+
header?: tailwind_merge.ClassNameValue;
|
45
|
+
label?: tailwind_merge.ClassNameValue;
|
46
|
+
section?: tailwind_merge.ClassNameValue;
|
47
|
+
list?: tailwind_merge.ClassNameValue;
|
48
|
+
description?: tailwind_merge.ClassNameValue;
|
49
|
+
item?: tailwind_merge.ClassNameValue;
|
50
|
+
};
|
51
|
+
};
|
52
|
+
} | {}, {
|
53
|
+
list: string;
|
54
|
+
section: string;
|
55
|
+
header: string;
|
56
|
+
item: string[];
|
57
|
+
content: string;
|
58
|
+
icon: string[];
|
59
|
+
label: string[];
|
60
|
+
description: string[];
|
61
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
62
|
+
list: string;
|
63
|
+
section: string;
|
64
|
+
header: string;
|
65
|
+
item: string[];
|
66
|
+
content: string;
|
67
|
+
icon: string[];
|
68
|
+
label: string[];
|
69
|
+
description: string[];
|
70
|
+
}, undefined, unknown, unknown, undefined>>;
|
71
|
+
|
72
|
+
export { OptionsStyles };
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import {tv}from'tailwind-variants';const i=tv({slots:{list:"group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light",section:"mt-s",header:"m-xs my-s text-default-dark text-header-xs",item:["group/options-item fg-default-light flex items-center gap-s p-s text-body-s","group-size-small/options:pt-xs group-size-small/options:pb-xs","group-size-large/options:pt-s group-size-large/options:pb-s","enabled:cursor-pointer","enabled:hover:fg-inverse-light","enabled:focus:fg-inverse-light","enabled:focus:color-info:bg-highlight-bold","enabled:hover:color-info:bg-highlight-bold","enabled:hover:color-serious:bg-serious-bold","enabled:focus:color-serious:bg-serious-bold","disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent"],content:"flex min-w-0 flex-auto flex-col gap-xxs",icon:["group-enabled/options-item:group-color-info/options-item:fg-default-light","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-color-serious/options-item:fg-serious","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-serious/options-item:fg-inverse-light"],label:["truncate","group-enabled/options-item:group-color-info/options-item:fg-default-light","group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-info/options-item:fg-inverse-light","group-enabled/options-item:group-color-serious/options-item:fg-serious","group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:group-color-serious/options-item:fg-inverse-light"],description:["group-enabled/options-item:fg-default-dark truncate text-body-xs","group-enabled/options-item:group-hover/options-item:fg-inverse-light","group-enabled/options-item:group-focus/options-item:fg-inverse-light","group-disabled/options-item:fg-disabled"]}});export{i as OptionsStyles};//# sourceMappingURL=styles.js.map
|
2
|
+
//# sourceMappingURL=styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../src/components/options/styles.ts"],"names":["OptionsStyles","tv"],"mappings":"mCAcO,MAAMA,CAAAA,CAAgBC,EAAAA,CAAG,CAC9B,KAAA,CAAO,CACL,IAAA,CAAM,qJAAA,CACN,OAAA,CAAS,MAAA,CACT,MAAA,CAAQ,4CAAA,CACR,IAAA,CAAM,CACJ,6EAAA,CACA,+DAAA,CACA,6DAAA,CACA,wBAAA,CACA,gCAAA,CACA,gCAAA,CACA,4CAAA,CACA,4CAAA,CACA,6CAAA,CACA,6CAAA,CACA,0EACF,CAAA,CACA,QAAS,yCAAA,CACT,IAAA,CAAM,CACJ,2EAAA,CACA,oGAAA,CACA,oGAAA,CACA,wEAAA,CACA,uGAAA,CACA,uGACF,CAAA,CACA,KAAA,CAAO,CACL,UAAA,CACA,2EAAA,CACA,oGAAA,CACA,oGAAA,CACA,wEAAA,CACA,uGAAA,CACA,uGACF,CAAA,CACA,WAAA,CAAa,CACX,kEAAA,CACA,sEAAA,CACA,sEAAA,CACA,yCACF,CACF,CACF,CAAC","file":"styles.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { tv } from 'tailwind-variants';\n\nexport const OptionsStyles = tv({\n slots: {\n list: 'group/options max-h-[200px] overflow-y-auto overflow-x-clip rounded-medium bg-surface-overlay shadow-elevation-overlay outline outline-static-light',\n section: 'mt-s',\n header: 'm-xs my-s text-default-dark text-header-xs',\n item: [\n 'group/options-item fg-default-light flex items-center gap-s p-s text-body-s',\n 'group-size-small/options:pt-xs group-size-small/options:pb-xs',\n 'group-size-large/options:pt-s group-size-large/options:pb-s',\n 'enabled:cursor-pointer',\n 'enabled:hover:fg-inverse-light',\n 'enabled:focus:fg-inverse-light',\n 'enabled:focus:color-info:bg-highlight-bold',\n 'enabled:hover:color-info:bg-highlight-bold',\n 'enabled:hover:color-serious:bg-serious-bold',\n 'enabled:focus:color-serious:bg-serious-bold',\n 'disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-transparent',\n ],\n content: 'flex min-w-0 flex-auto flex-col gap-xxs',\n icon: [\n 'group-enabled/options-item:group-color-info/options-item:fg-default-light',\n 'group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-color-serious/options-item:fg-serious',\n 'group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus/options-item:group-color-serious/options-item:fg-inverse-light',\n ],\n label: [\n 'truncate',\n 'group-enabled/options-item:group-color-info/options-item:fg-default-light',\n 'group-enabled/options-item:group-hover/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus/options-item:group-color-info/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-color-serious/options-item:fg-serious',\n 'group-enabled/options-item:group-hover/options-item:group-color-serious/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus/options-item:group-color-serious/options-item:fg-inverse-light',\n ],\n description: [\n 'group-enabled/options-item:fg-default-dark truncate text-body-xs',\n 'group-enabled/options-item:group-hover/options-item:fg-inverse-light',\n 'group-enabled/options-item:group-focus/options-item:fg-inverse-light',\n 'group-disabled/options-item:fg-disabled',\n ],\n },\n});\n"]}
|