@accelint/design-toolkit 4.0.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/accordion/index.d.ts +1 -1
- package/dist/components/accordion/index.js +1 -1
- package/dist/components/accordion/index.js.map +1 -1
- package/dist/components/accordion/styles.js +1 -1
- package/dist/components/accordion/styles.js.map +1 -1
- package/dist/components/accordion/types.d.ts +1 -1
- package/dist/components/action-bar/index.d.ts +10 -0
- package/dist/components/action-bar/index.js +2 -0
- package/dist/components/action-bar/index.js.map +1 -0
- package/dist/components/action-bar/styles.d.ts +5 -0
- package/dist/components/action-bar/styles.js +2 -0
- package/dist/components/action-bar/styles.js.map +1 -0
- package/dist/components/action-bar/types.d.ts +5 -0
- package/dist/components/action-bar/types.js +2 -0
- package/dist/components/action-bar/types.js.map +1 -0
- package/dist/components/avatar/index.d.ts +1 -1
- package/dist/components/avatar/index.js +1 -1
- package/dist/components/avatar/index.js.map +1 -1
- package/dist/components/avatar/styles.js +1 -1
- package/dist/components/avatar/styles.js.map +1 -1
- package/dist/components/avatar/types.d.ts +1 -1
- package/dist/components/badge/index.d.ts +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/button/index.d.ts +1 -1
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/button/styles.js +1 -1
- package/dist/components/button/styles.js.map +1 -1
- package/dist/components/button/types.d.ts +1 -1
- package/dist/components/checkbox/styles.js +1 -1
- package/dist/components/checkbox/styles.js.map +1 -1
- package/dist/components/chip/index.d.ts +1 -1
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/chip/styles.js +1 -1
- package/dist/components/chip/styles.js.map +1 -1
- package/dist/components/classification-badge/index.d.ts +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-banner/index.d.ts +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/color-picker/styles.js +1 -1
- package/dist/components/color-picker/styles.js.map +1 -1
- package/dist/components/combobox-field/index.d.ts +1 -1
- package/dist/components/combobox-field/index.js.map +1 -1
- package/dist/components/combobox-field/styles.js +1 -1
- package/dist/components/combobox-field/styles.js.map +1 -1
- package/dist/components/combobox-field/types.d.ts +1 -1
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/details-list/index.d.ts +1 -1
- package/dist/components/details-list/index.js +1 -1
- package/dist/components/details-list/index.js.map +1 -1
- package/dist/components/details-list/styles.js +1 -1
- package/dist/components/details-list/styles.js.map +1 -1
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/styles.js +1 -1
- package/dist/components/dialog/styles.js.map +1 -1
- package/dist/components/drawer/index.d.ts +1 -1
- package/dist/components/drawer/index.js +1 -1
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/drawer/styles.d.ts +2 -2
- package/dist/components/drawer/styles.js +1 -1
- package/dist/components/drawer/styles.js.map +1 -1
- package/dist/components/drawer/types.d.ts +1 -1
- package/dist/components/hero/index.js +1 -1
- package/dist/components/hero/index.js.map +1 -1
- package/dist/components/hero/styles.js +1 -1
- package/dist/components/hero/styles.js.map +1 -1
- package/dist/components/hotkey/index.d.ts +1 -1
- package/dist/components/hotkey/index.js.map +1 -1
- package/dist/components/hotkey/styles.js +1 -1
- package/dist/components/hotkey/styles.js.map +1 -1
- package/dist/components/icon/index.d.ts +1 -1
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/input/index.d.ts +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/label/index.d.ts +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/lines/index.d.ts +9 -0
- package/dist/components/lines/index.js +2 -0
- package/dist/components/lines/index.js.map +1 -0
- package/dist/components/lines/styles.d.ts +32 -0
- package/dist/components/lines/styles.js +2 -0
- package/dist/components/lines/styles.js.map +1 -0
- package/dist/components/lines/types.d.ts +10 -0
- package/dist/components/lines/types.js +2 -0
- package/dist/components/lines/types.js.map +1 -0
- package/dist/components/link/index.d.ts +17 -0
- package/dist/components/link/index.js +2 -0
- package/dist/components/link/index.js.map +1 -0
- package/dist/components/link/styles.d.ts +5 -0
- package/dist/components/link/styles.js +2 -0
- package/dist/components/link/styles.js.map +1 -0
- package/dist/components/link/types.d.ts +9 -0
- package/dist/components/link/types.js +2 -0
- package/dist/components/link/types.js.map +1 -0
- 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/options/index.js.map +1 -1
- package/dist/components/options/styles.js +1 -1
- package/dist/components/options/styles.js.map +1 -1
- package/dist/components/popover/index.js.map +1 -1
- 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.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.js +1 -1
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/styles.js +1 -1
- package/dist/components/radio/styles.js.map +1 -1
- package/dist/components/search-field/index.d.ts +3 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/search-field/styles.js +1 -1
- package/dist/components/search-field/styles.js.map +1 -1
- package/dist/components/select-field/index.d.ts +1 -1
- package/dist/components/select-field/index.js +1 -1
- package/dist/components/select-field/index.js.map +1 -1
- package/dist/components/select-field/styles.js +1 -1
- package/dist/components/select-field/styles.js.map +1 -1
- package/dist/components/select-field/types.d.ts +1 -1
- package/dist/components/sidenav/events.d.ts +8 -0
- package/dist/components/sidenav/events.js +2 -0
- package/dist/components/sidenav/events.js.map +1 -0
- package/dist/components/sidenav/index.d.ts +51 -0
- package/dist/components/sidenav/index.js +2 -0
- package/dist/components/sidenav/index.js.map +1 -0
- package/dist/components/sidenav/styles.d.ts +114 -0
- package/dist/components/sidenav/styles.js +2 -0
- package/dist/components/sidenav/styles.js.map +1 -0
- package/dist/components/sidenav/types.d.ts +38 -0
- package/dist/components/sidenav/types.js +2 -0
- package/dist/components/sidenav/types.js.map +1 -0
- package/dist/components/skeleton/styles.d.ts +2 -2
- package/dist/components/skeleton/styles.js +1 -1
- package/dist/components/skeleton/styles.js.map +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/styles.js +1 -1
- package/dist/components/slider/styles.js.map +1 -1
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.js +1 -1
- package/dist/components/switch/styles.js.map +1 -1
- package/dist/components/tabs/index.d.ts +37 -36
- package/dist/components/tabs/index.js +1 -1
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/tabs/styles.d.ts +48 -0
- package/dist/components/tabs/styles.js +2 -0
- package/dist/components/tabs/styles.js.map +1 -0
- package/dist/components/tabs/types.d.ts +6 -0
- package/dist/components/tabs/types.js +2 -0
- package/dist/components/tabs/types.js.map +1 -0
- package/dist/components/text-area-field/index.d.ts +1 -1
- package/dist/components/text-area-field/index.js.map +1 -1
- package/dist/components/text-area-field/styles.js +1 -1
- package/dist/components/text-area-field/styles.js.map +1 -1
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/text-field/styles.js +1 -1
- package/dist/components/text-field/styles.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +1 -1
- package/dist/components/tooltip/index.js +1 -1
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tooltip/styles.d.ts +1 -1
- package/dist/components/tooltip/styles.js +1 -1
- package/dist/components/tooltip/styles.js.map +1 -1
- package/dist/components/tooltip/types.d.ts +3 -1
- package/dist/components/tree/index.d.ts +51 -0
- package/dist/components/tree/index.js +2 -0
- package/dist/components/tree/index.js.map +1 -0
- package/dist/components/tree/styles.d.ts +128 -0
- package/dist/components/tree/styles.js +2 -0
- package/dist/components/tree/styles.js.map +1 -0
- package/dist/components/tree/types.d.ts +41 -0
- package/dist/components/tree/types.js +2 -0
- package/dist/components/tree/types.js.map +1 -0
- package/dist/components/view-stack/index.js.map +1 -1
- package/dist/foundation/token-data.d.ts +17 -0
- package/dist/foundation/token-data.js +2 -0
- package/dist/foundation/token-data.js.map +1 -0
- package/dist/hooks/use-tree/actions/cache.d.ts +78 -0
- package/dist/hooks/use-tree/actions/cache.js +2 -0
- package/dist/hooks/use-tree/actions/cache.js.map +1 -0
- package/dist/hooks/use-tree/actions/index.d.ts +38 -0
- package/dist/hooks/use-tree/actions/index.js +2 -0
- package/dist/hooks/use-tree/actions/index.js.map +1 -0
- package/dist/hooks/use-tree/state/index.d.ts +8 -0
- package/dist/hooks/use-tree/state/index.js +2 -0
- package/dist/hooks/use-tree/state/index.js.map +1 -0
- package/dist/hooks/use-tree/state/utils.d.ts +7 -0
- package/dist/hooks/use-tree/state/utils.js +2 -0
- package/dist/hooks/use-tree/state/utils.js.map +1 -0
- package/dist/hooks/use-tree/types.d.ts +171 -0
- package/dist/hooks/use-tree/types.js +2 -0
- package/dist/hooks/use-tree/types.js.map +1 -0
- package/dist/icons/catalog.js +1 -1
- package/dist/icons/catalog.js.map +1 -1
- package/dist/index.css +9 -15
- package/dist/index.d.ts +26 -3
- package/dist/index.js +1 -1
- package/dist/lib/react.d.ts +22 -8
- package/dist/lib/react.js +8 -4
- package/dist/lib/react.js.map +1 -1
- package/dist/lib/utils.d.ts +2 -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/providers/theme-provider.d.ts +22 -0
- package/dist/providers/theme-provider.js +2 -0
- package/dist/providers/theme-provider.js.map +1 -0
- package/dist/styles.css +1606 -904
- package/dist/tokens/themes.css +729 -53
- package/dist/tokens/tokens.css +121 -65
- package/dist/tokens/tokens.d.ts +449 -1
- package/dist/tokens/tokens.js +2 -0
- package/dist/tokens/tokens.js.map +1 -0
- package/dist/tokens/types.d.ts +299 -0
- package/dist/tokens/types.js +2 -0
- package/dist/tokens/types.js.map +1 -0
- package/dist/variants/variants.css +6 -1
- package/package.json +10 -6
- package/dist/tokens/index.d.ts +0 -123
- package/dist/tokens/index.js +0 -2
- package/dist/tokens/index.js.map +0 -1
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
import * as tailwind_merge from 'tailwind-merge';
|
|
3
|
+
|
|
4
|
+
declare const TabStyles: tailwind_variants.TVReturnType<{
|
|
5
|
+
[key: string]: {
|
|
6
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
|
+
list?: tailwind_merge.ClassNameValue;
|
|
8
|
+
tab?: tailwind_merge.ClassNameValue;
|
|
9
|
+
panel?: tailwind_merge.ClassNameValue;
|
|
10
|
+
tabs?: tailwind_merge.ClassNameValue;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
} | {
|
|
14
|
+
[x: string]: {
|
|
15
|
+
[x: string]: tailwind_merge.ClassNameValue | {
|
|
16
|
+
list?: tailwind_merge.ClassNameValue;
|
|
17
|
+
tab?: tailwind_merge.ClassNameValue;
|
|
18
|
+
panel?: tailwind_merge.ClassNameValue;
|
|
19
|
+
tabs?: tailwind_merge.ClassNameValue;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
} | {}, {
|
|
23
|
+
tabs: string[];
|
|
24
|
+
list: string[];
|
|
25
|
+
tab: string[];
|
|
26
|
+
panel: string;
|
|
27
|
+
}, undefined, {
|
|
28
|
+
[key: string]: {
|
|
29
|
+
[key: string]: tailwind_merge.ClassNameValue | {
|
|
30
|
+
list?: tailwind_merge.ClassNameValue;
|
|
31
|
+
tab?: tailwind_merge.ClassNameValue;
|
|
32
|
+
panel?: tailwind_merge.ClassNameValue;
|
|
33
|
+
tabs?: tailwind_merge.ClassNameValue;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
} | {}, {
|
|
37
|
+
tabs: string[];
|
|
38
|
+
list: string[];
|
|
39
|
+
tab: string[];
|
|
40
|
+
panel: string;
|
|
41
|
+
}, tailwind_variants.TVReturnType<unknown, {
|
|
42
|
+
tabs: string[];
|
|
43
|
+
list: string[];
|
|
44
|
+
tab: string[];
|
|
45
|
+
panel: string;
|
|
46
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
47
|
+
|
|
48
|
+
export { TabStyles };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {tv}from'tailwind-variants';const e=tv({slots:{tabs:["group/tabs flex w-content","orientation-horizontal:flex-col","orientation-vertical:flex-row"],list:["flex","orientation-horizontal:flex-row","orientation-vertical:flex-col"],tab:["fg-primary-muted relative cursor-pointer rounded-small p-s","group-orientation-horizontal/tabs:rounded-b-none","group-orientation-horizontal/tabs:after:absolute group-orientation-horizontal/tabs:after:bottom-0 group-orientation-horizontal/tabs:after:left-0 group-orientation-horizontal/tabs:after:block group-orientation-horizontal/tabs:after:h-[1px] group-orientation-horizontal/tabs:after:w-full group-orientation-horizontal/tabs:after:bg-[color:var(--outline-static)]","enabled:hover:fg-primary-bold","enabled:hover:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]","enabled:focus:fg-primary-bold","enabled:focus:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]","enabled:selected:fg-accent-primary-bold selected:bg-accent-primary-muted","enabled:selected:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]","enabled:selected:hover:fg-accent-primary-bold","enabled:selected:hover:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]","enabled:selected:focus:fg-accent-primary-bold","enabled:selected:focus:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]","disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-interactive-disabled","disabled:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-interactive-disabled)]"],panel:"fg-primary-bold p-s"}});export{e as TabStyles};//# sourceMappingURL=styles.js.map
|
|
2
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tabs/styles.ts"],"names":["TabStyles","tv"],"mappings":"yCAcaA,CAAAA,CAAYC,EAAAA,CAAG,CAC1B,KAAA,CAAO,CACL,KAAM,CACJ,2BAAA,CACA,kCACA,+BACF,CAAA,CACA,KAAM,CACJ,MAAA,CACA,kCACA,+BACF,CAAA,CACA,GAAA,CAAK,CACH,6DACA,kDAAA,CACA,wWAAA,CAEA,gCACA,qGAAA,CAEA,+BAAA,CACA,sGAEA,0EAAA,CACA,wGAAA,CAEA,gDACA,8GAAA,CAEA,+CAAA,CACA,+GAEA,mFAAA,CACA,iGACF,EACA,KAAA,CAAO,qBACT,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 TabStyles = tv({\n slots: {\n tabs: [\n 'group/tabs flex w-content',\n 'orientation-horizontal:flex-col',\n 'orientation-vertical:flex-row',\n ],\n list: [\n 'flex',\n 'orientation-horizontal:flex-row',\n 'orientation-vertical:flex-col',\n ],\n tab: [\n 'fg-primary-muted relative cursor-pointer rounded-small p-s',\n 'group-orientation-horizontal/tabs:rounded-b-none',\n 'group-orientation-horizontal/tabs:after:absolute group-orientation-horizontal/tabs:after:bottom-0 group-orientation-horizontal/tabs:after:left-0 group-orientation-horizontal/tabs:after:block group-orientation-horizontal/tabs:after:h-[1px] group-orientation-horizontal/tabs:after:w-full group-orientation-horizontal/tabs:after:bg-[color:var(--outline-static)]',\n\n 'enabled:hover:fg-primary-bold',\n 'enabled:hover:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]',\n\n 'enabled:focus:fg-primary-bold',\n 'enabled:focus:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]',\n\n 'enabled:selected:fg-accent-primary-bold selected:bg-accent-primary-muted',\n 'enabled:selected:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]',\n\n 'enabled:selected:hover:fg-accent-primary-bold',\n 'enabled:selected:hover:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]',\n\n 'enabled:selected:focus:fg-accent-primary-bold',\n 'enabled:selected:focus:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-accent-primary-bold)]',\n\n 'disabled:fg-disabled disabled:cursor-not-allowed disabled:bg-interactive-disabled',\n 'disabled:group-orientation-horizontal/tabs:after:bg-[color:var(--outline-interactive-disabled)]',\n ],\n panel: 'fg-primary-bold p-s',\n },\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"types.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
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';
|
|
4
3
|
import { ContextValue } from 'react-aria-components';
|
|
4
|
+
import { ProviderProps } from '../../lib/types.js';
|
|
5
5
|
import { TextAreaFieldProps } from './types.js';
|
|
6
6
|
|
|
7
7
|
declare const TextAreaFieldContext: react.Context<ContextValue<TextAreaFieldProps, HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/text-area-field/index.tsx"],"names":["label","input","description","TextAreaFieldContext","E","b","props","jsx","e","TextAreaFieldProvider","useContextProps","ref","M","descriptionProp","errorMessageProp","inputProps","isSmall","size","L","composeRenderProps","classNames","className","field","isInvalidProp","errorMessage","isDisabled","isInvalid","isRequired","k","V","labelProp","Label","C","Text","y","error"],"mappings":"iSA8Be,MAAA,CAAAA,KAAO,CAAA,CAAA,CAAAC,KAAO,CAAA,CAAA,CAAA,KAAA,CAAAC,CAAAA,CAAa,WAAyB,CAAA,CAEtDC,CAAAA,KACqD,CAAA,CAAI,CAAA,CAEtEC,cAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAGC,QAEH,CAAA,CAAA,CACEC,GAACJ,CAAqB,CAAA,CAAA,CAAA,OAASK,GAAA,CAAA,CAAA,CAAA,QAC5B,CAAA,CAAA,KACH,CAEJ,CACAC,CAAAA,QAAsB,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,wBAsBJ,CAAA,SAAc,CAAuB,CACnE,CAACH,GAAU,CAAA,CAAII,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,CAAA,CAAA,CAAA,CAAA,CAAMR,CAAoB,CAAAS,eAEvE,CAAA,CAAA,CAAA,CAAA,EACE,IAAA,CAAA,CAAA,CAAA,CAAA,KACA,CAAA,UAAA,CAAaC,CAAAA,CACb,WAAA,CAAA,CAAcC,CAAAA,YAEd,CAAA,CAAA,CAAA,KAAAC,CAAAA,CACA,CAAA,UAAO,CAAA,CAAA,CAAA,IACP,CAAA,CAAA,CAAA,QACA,CAAA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AAA,SAAA,CAAY,CAAC,EAE5D,WACH,CAAA,CAEFb,CAAAA,QACE,CAAA,CAAA,CAAA,CAAA,CAAAC,GAAWW,CAAAA,UAAmBC,CAAAA,CAAAA,SAAoBC,CAChDc,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEC,CAAAX,CAAAA,CACH,CAAA,CAAA,CACF,QAKM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,eACHf,CAAAA,CAAAA,CAAAA,QAAAA,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
|
|
1
|
+
{"version":3,"sources":["../../../src/components/text-area-field/index.tsx"],"names":["label","input","description","TextAreaFieldContext","E","b","props","jsx","e","TextAreaFieldProvider","useContextProps","ref","M","descriptionProp","errorMessageProp","inputProps","isSmall","size","L","composeRenderProps","classNames","className","field","isInvalidProp","errorMessage","isDisabled","isInvalid","isRequired","k","V","labelProp","Label","C","Text","y","error"],"mappings":"iSA8Be,MAAA,CAAAA,KAAO,CAAA,CAAA,CAAAC,KAAO,CAAA,CAAA,CAAA,KAAA,CAAAC,CAAAA,CAAa,WAAyB,CAAA,CAEtDC,CAAAA,KACqD,CAAA,CAAI,CAAA,CAEtEC,cAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IACE,EAAA,SACA,CAAA,CAAA,CAAGC,QAEH,CAAA,C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AAM,CAAE,CAAA,SAAWoB,CAAAA,CAAAA,CAAY,CAAA,SAC1C,CAAA,CAAA,EAAA,KAAYK,CAAAA,CACZ,CAAA,UAAYE,CAAAA,CAEX,CAAA,UACH,CAAA,CAEFpB,CAAAA,QACMQ,CACJ,CAAA,CAAA,CAAA,CAAAP,GAAA,CAAAwB,QAAA,CAAA,CAAA,GAA8BZ,CAAAA,CAAAA,SAAoBC,CAChDpB,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEoB,CAAEe,CAAAA,CAAAA,CAAWU,CAAAA,CAAAA,CAAAA,CACjCnB,CAAAA,CAAC0B,CAAAA,EACC,EAAA,CAAA,EAAK,CAAA,CAAA,EAAAzB,GAAA,CAAA0B,IAAA,CAAA,CAAA,IAAA,CACL,aAAyB,CAAA,SAAWd,CAAAA,CAAAA,CAAY,CAAA,SAAA,CAAY,CAAC,EAE5D,WACH,CAAA,CAEFb,CAAAA,QACE,CAAA,CAAA,CAAA,CAAA,CAAAC,GAAWW,CAAAA,UAAmBC,CAAAA,CAAAA,SAAoBC,CAChDc,kBAAAA,CAAM,CAAE,EAAA,KAAA,CAAA,CAAA,EAAU,CAAC,CACrB,CAAA,SAEC,CAAAX,CAAAA,CACH,CAAA,CAAA,CACF,QAKM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,eACHf,CAAAA,CAAAA,CAAAA,QAAAA,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 { createContext } from 'react';\nimport {\n type ContextValue,\n composeRenderProps,\n FieldError,\n Text,\n TextArea,\n TextField,\n useContextProps,\n} from 'react-aria-components';\nimport { Label } from '../label';\nimport { TextAreaStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { TextAreaFieldProps } from './types';\n\nconst { field, label, input, description, error } = TextAreaStyles();\n\nexport const TextAreaFieldContext =\n createContext<ContextValue<TextAreaFieldProps, HTMLDivElement>>(null);\n\nfunction TextAreaFieldProvider({\n children,\n ...props\n}: ProviderProps<TextAreaFieldProps>) {\n return (\n <TextAreaFieldContext.Provider value={props}>\n {children}\n </TextAreaFieldContext.Provider>\n );\n}\nTextAreaFieldProvider.displayName = 'TextAreaField.Provider';\n\n/**\n * TextAreaField - A multi-line text input component with label and validation\n *\n * Provides a complete form field experience for longer text content with integrated\n * label, description, and error message components. Handles validation states and\n * accessibility automatically while supporting resizable text areas.\n *\n * @example\n * // Basic text area field\n * <TextAreaField label=\"Comments\" />\n *\n * @example\n * // Text area with validation\n * <TextAreaField\n * isInvalid={true}\n * errorMessage='Message is required'\n * label='Foo'\n * isRequired\n * />\n */\nexport function TextAreaField({ ref, ...props }: TextAreaFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextAreaFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n label: labelProp,\n inputProps,\n size = 'medium',\n isInvalid: isInvalidProp,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <TextField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n data-size={size}\n >\n {(\n { isDisabled, isInvalid, isRequired }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={label({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <TextArea\n {...inputProps}\n className={composeRenderProps(classNames?.input, (className) =>\n input({ className }),\n )}\n />\n {!!descriptionProp && !(isSmall || isInvalid) && (\n <Text\n slot='description'\n className={description({ className: classNames?.description })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </TextField>\n );\n}\nTextAreaField.displayName = 'TextAreaField';\nTextAreaField.Provider = TextAreaFieldProvider;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const l=tv({slots:{field:"group/text-area-field flex flex-col gap-xs",label:"",input:["block w-full rounded-medium p-s font-display
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const l=tv({slots:{field:"group/text-area-field flex flex-col gap-xs",label:"",input:["fg-primary-bold placeholder:fg-primary-muted block w-full rounded-medium p-s font-display outline outline-interactive","group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs","group-enabled/text-area-field:focus-visible:outline-accent-primary-bold","group-enabled/text-area-field:hover:outline-interactive-hover","group-enabled/text-area-field:group-invalid/text-area-field:outline-serious-bold","group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled"],description:["fg-primary-muted text-body-xs","group-disabled/text-area-field:fg-disabled"],error:"fg-serious-bold text-body-xs"}});export{l as TextAreaStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/text-area-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,4CAEP,CAAA,KAAO,CACL,EAAA,CAAA,KAAA,CAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/text-area-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,4CAEP,CAAA,KAAO,CACL,EAAA,CAAA,KAAA,CAAA,CAAA,uHACA,CAAA,6FACA,CAAA,yEACA,CAAA,+DACA,CAAA,kFACA,CAAA,mKAEF,CAAA,CAAA,WACE,CAAA,CAAA,+BACA,CAAA,4CAEK,CAAA,CAAA,KAAA,CAAA,8BAEV,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 TextAreaStyles = tv({\n slots: {\n field: 'group/text-area-field flex flex-col gap-xs',\n label: '',\n input: [\n 'fg-primary-bold placeholder:fg-primary-muted block w-full rounded-medium p-s font-display outline outline-interactive',\n 'group-size-medium/text-area-field:text-body-s group-size-small/text-area-field:text-body-xs',\n 'group-enabled/text-area-field:focus-visible:outline-accent-primary-bold',\n 'group-enabled/text-area-field:hover:outline-interactive-hover',\n 'group-enabled/text-area-field:group-invalid/text-area-field:outline-serious-bold',\n 'group-disabled/text-area-field:text-disabled group-disabled/text-area-field:outline-interactive-disabled group-disabled/text-area-field:placeholder:text-disabled',\n ],\n description: [\n 'fg-primary-muted text-body-xs',\n 'group-disabled/text-area-field:fg-disabled',\n ],\n error: 'fg-serious-bold text-body-xs',\n },\n});\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/text-field/index.tsx"],"names":["description","TextFieldStyles","TextFieldProvider","N","children","e","props","ref","L","rest","errorMessageProp","size","AriaTextField","composeRenderProps","classNames","className","field","c","isDisabled","isInvalid","isRequired","labelProp","isSmall","jsx","Label","label","g","inputProps","M","descriptionProp","I","error","errorMessage","TextField"],"mappings":"+
|
|
1
|
+
{"version":3,"sources":["../../../src/components/text-field/index.tsx"],"names":["description","TextFieldStyles","TextFieldProvider","N","children","e","props","ref","L","rest","errorMessageProp","size","AriaTextField","composeRenderProps","classNames","className","field","c","isDisabled","isInvalid","isRequired","labelProp","isSmall","jsx","Label","label","g","inputProps","M","descriptionProp","I","error","errorMessage","TextField"],"mappings":"+TA6BsB,MAAA,CAAA,KAAAA,CAAa,CAAA,CAAA,KAAM,CAAA,CAAIC,CAAAA,WAGqB,CAAA,CAElE,CAAA,KAAA,CAAA,CAAA,CAASC,CAAAA,eAAkB,EACzB,CAAA,CAAA,CAAAC,aAAA,CAAA,IAAAC,EACA,SAEA,CAAA,CAAA,CAAA,QACoB,CAAA,CAAA,CAAA,GAAjB,CAA0B,CAAA,CAAA,CAAA,OACxBC,GAAA,CAAA,CAAA,CAAA,QAIPH,CAAkB,CAAA,KAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,WAgEzB,CAAA,oBAAmC,CAAmB,SAC5BI,CAAAA,CAAOC,CAAAA,GAAO,CAAA,CAAA,CAAA,GAAsB,CAEnE,CAAA,CAAA,CAAA,CAAA,CAAM,CACJ,CAAA,CAAA,CAAAC,eAAA,CAAA,CAAA,CAAA,CAAA,EAAA,IACA,CAAA,CAAA,CAAA,CAAA,KAAA,CAAA,UACA,CAAA,CAAA,CAAA,WACA,CAAA,CAAA,CAAA,YAEA,CAAA,CAAA,CAAA,UAAO,CAAA,CAAA,CACP,KAAA,CAAA,CAAA,CAAA,IACA,CAAA,CAAA,CAAGC,QAEgBC,CAAAA,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CAAA,EAAAe,WAIH,CAAA,CAAA,CAAA,QAA8Bf,CAAY,CAAA,CAAA,CAAA,CAAAT,GAAA,CAAQU,UAAAA,CAAAA,CAChDgB,SAAQ,CAAAd,kBAAA,CAAA,CAAAF,EAAW,KAGpB,CAAA,CAAA,EAAA,CAAA,CAAA,CAAAiB,SAObC,CAAAA,CAAU,CAAA,CAAA,CAAA,CAAA,QAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CACxBA,WAAqB/B,CAAAA,WAAAA,CAAAA,CAAAA,CAAAA,QAAAA,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 TextField as AriaTextField,\n type ContextValue,\n composeRenderProps,\n FieldError,\n Text,\n useContextProps,\n} from 'react-aria-components';\nimport { Input } from '../input';\nimport { Label } from '../label';\nimport { TextFieldStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { TextFieldProps } from './types';\n\nconst { field, label, description, error } = TextFieldStyles();\n\nexport const TextFieldContext =\n createContext<ContextValue<TextFieldProps, HTMLDivElement>>(null);\n\nfunction TextFieldProvider({\n children,\n ...props\n}: ProviderProps<TextFieldProps>) {\n return (\n <TextFieldContext.Provider value={props}>\n {children}\n </TextFieldContext.Provider>\n );\n}\nTextFieldProvider.displayName = 'TextField.Provider';\n\n/**\n * TextField - A complete form field component with label, input, and validation\n *\n * Provides a comprehensive form field experience combining label, input, description,\n * and error message components. Handles validation states and accessibility\n * automatically while supporting extensive customization through styling props.\n *\n * @example\n * // Basic text field with label and required validation\n * <TextField label='Full Name' isRequired defaultValue='John Doe' />\n *\n * @example\n * // Text field with placeholder and description\n * <TextField\n * label='Email Address'\n * inputProps={{ placeholder: 'Enter your email address', type: 'email' }}\n * description='We will never share your email with third parties'\n * />\n *\n * @example\n * // Text field with error state\n * <TextField\n * label='Username'\n * isInvalid\n * errorMessage='Username must be at least 3 characters long'\n * inputProps={{ placeholder: 'Enter username' }}\n * />\n *\n * @example\n * // Small size text field with clearable input\n * <TextField\n * label='Search'\n * size='small'\n * inputProps={{\n * placeholder: 'Type to search...',\n * isClearable: true,\n * type: 'search'\n * }}\n * />\n *\n * @example\n * // Disabled text field\n * <TextField\n * label='Status'\n * isDisabled\n * defaultValue='Inactive'\n * description='This field cannot be edited'\n * />\n *\n * @example\n * // Password field with validation\n * <TextField\n * label='Password'\n * isRequired\n * inputProps={{\n * type: 'password',\n * placeholder: 'Enter a secure password',\n * minLength: 8\n * }}\n * description='Password must be at least 8 characters'\n * />\n */\nexport function TextField({ ref, ...props }: TextFieldProps) {\n [props, ref] = useContextProps(props, ref ?? null, TextFieldContext);\n\n const {\n classNames,\n description: descriptionProp,\n errorMessage: errorMessageProp,\n inputProps,\n label: labelProp,\n size = 'medium',\n isInvalid: isInvalidProp,\n ...rest\n } = props;\n const errorMessage = errorMessageProp || null; // Protect against empty string\n const isSmall = size === 'small';\n\n return (\n <AriaTextField\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.field, (className) =>\n field({ className }),\n )}\n isInvalid={isInvalidProp || (errorMessage ? true : undefined)} // Leave uncontrolled if possible to fallback to validation state\n data-size={size}\n >\n {(\n { isDisabled, isInvalid, isRequired }, // Rely on internal state, not props, since state could differ from props\n ) => (\n <>\n {!!labelProp && !isSmall && (\n <Label\n className={label({ className: classNames?.label })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n >\n {labelProp}\n </Label>\n )}\n <Input\n {...inputProps}\n classNames={classNames?.input}\n disabled={isDisabled}\n required={isRequired}\n size={size}\n isInvalid={isInvalid}\n />\n {!!descriptionProp && !(isSmall || isInvalid) && (\n <Text\n slot='description'\n className={description({ className: classNames?.description })}\n >\n {descriptionProp}\n </Text>\n )}\n <FieldError\n className={composeRenderProps(classNames?.error, (className) =>\n error({ className }),\n )}\n >\n {errorMessage}\n </FieldError>\n </>\n )}\n </AriaTextField>\n );\n}\nTextField.displayName = 'TextField';\nTextField.Provider = TextFieldProvider;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const l=tv({slots:{field:"group/text-field flex flex-col gap-xs",label:"",input:"",description:["fg-
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const l=tv({slots:{field:"group/text-field flex flex-col gap-xs",label:"",input:"",description:["fg-primary-muted text-body-xs","group-disabled/text-field:fg-disabled"],error:"fg-serious-bold text-body-xs"}});export{l as TextFieldStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/text-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,uCAEP,CAAA,KAAO,CAAA,EACP,CAAA,KAAA,CAAA,EAAA,CAAA,WACE,CAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/text-field/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,EAAA,CAAA,CAAA,KAAO,CAAA,CAAA,KAAA,CAAA,uCAEP,CAAA,KAAO,CAAA,EACP,CAAA,KAAA,CAAA,EAAA,CAAA,WACE,CAAA,CAAA,uEAGK,CAAA,CAAA,KAAA,CAAA,8BAEV,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 TextFieldStyles = tv({\n slots: {\n field: 'group/text-field flex flex-col gap-xs',\n label: '',\n input: '',\n description: [\n 'fg-primary-muted text-body-xs',\n 'group-disabled/text-field:fg-disabled',\n ],\n error: 'fg-serious-bold text-body-xs',\n },\n});\n"]}
|
|
@@ -56,7 +56,7 @@ declare function TooltipTrigger({ children, ...props }: TooltipTriggerProps): re
|
|
|
56
56
|
declare namespace TooltipTrigger {
|
|
57
57
|
var displayName: string;
|
|
58
58
|
}
|
|
59
|
-
declare function TooltipBody({ children, className, offset, placement, ...props }: TooltipBodyProps): react_jsx_runtime.JSX.Element;
|
|
59
|
+
declare function TooltipBody({ children, parentRef, className, offset, placement, ...props }: TooltipBodyProps): react_jsx_runtime.JSX.Element;
|
|
60
60
|
declare namespace TooltipBody {
|
|
61
61
|
var displayName: string;
|
|
62
62
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {createContext}from'react';import'client-only';import {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {createContext,useState,useEffect}from'react';import'client-only';import {UNSAFE_PortalProvider}from'@react-aria/overlays';import {useIsSSR}from'@react-aria/ssr';import {useContextProps,TooltipTrigger,Focusable,Tooltip,composeRenderProps}from'react-aria-components';import {containsExactChildren}from'./../../lib/react.js';import {TooltipStyles}from'./styles.js';const B=createContext(null);function p({ref:t,...o}){[o,t]=useContextProps(o,t??null,B);const{children:r,delay:s=250,...a}=o;return containsExactChildren({children:r,componentName:p.displayName,restrictions:[[m,{min:1,max:1}],[T,{min:1,max:1}]]}),jsx(TooltipTrigger,{...a,delay:s,children:r})}p.displayName="Tooltip";function m({children:t,...o}){return jsx(Focusable,{...o,children:t})}m.displayName="Tooltip.Trigger";function T({children:t,parentRef:o,className:r,offset:s=5,placement:a="bottom",...u}){const i=useIsSSR(),[d,c]=useState(i?null:document.body);return useEffect(()=>{const l=o?.current,e=i?null:document.createElement("div");return e?.setAttribute("style","position: absolute;"),l&&e&&(l.appendChild(e),c(e)),()=>{e?.remove(),c(i?null:document.body);}},[i,o]),jsx(UNSAFE_PortalProvider,{getContainer:()=>d,children:jsx(Tooltip,{...u,className:composeRenderProps(r,l=>TooltipStyles({className:l})),offset:s,placement:a,children:t})})}T.displayName="Tooltip.Body",p.Trigger=m,p.Body=T;export{p as Tooltip,B as TooltipContext};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tooltip/index.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tooltip/index.tsx"],"names":["y","props","useContextProps","ref","TooltipContext","A","E","Tooltip","jsx","AriaTooltipTrigger","rest","delay","Focusable","n","b","children","TooltipTrigger","parentRef","className","placement","isSSR","portal","x","P","useEffect","node","port","setPortal","UNSAFE_PortalProvider","f","AriaTooltip","C","S","v","offset","TooltipBody"],"mappings":"sZA6EO,MAAA,CAAA,CAAAA,aAAA,CAAA,IAAmB,EAAA,SAAc,CAAiB,CACvD,CAACC,GAAU,CAAA,CAAIC,CAAAA,GAAuBC,CAAAA,CAAAA,CAAO,KAAMC,CAAc,CAAAC,eAEjE,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAQ,CAAK,CAAA,CAAA,KAAYJ,CAE3C,CAAA,CAAA,GAAA,CAAA,GAAsB,CACpB,CAAA,CAAA,CAAA,CAAA,OACAK,qBAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CA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,CAAA,CAAA,IAENC,CAAUP,CAAAA,EAAQ,MAAO,EAAA,CAAA,CAAA,CAAA,CAAA,CAAS,IAAI,CACxC,QACmB,CAAA,IAGlBQ,EAAA,CAAsB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAAf,GAAA,CAAAgB,qBAAA,CAAc,aACnC,CAAA,IAACC,CAAA,CACE,QACD,CAAAjB,GAAA,CAAAkB,OAAA,CAAA,CAAA,GAA8Bb,CAAAA,CAAYA,SACxB,CAAAc,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAUC,aAAC,CAC7B,CAAA,SACQC,CACR,CAAA,CAAA,CAAA,CAAA,CAAA,MAAWf,CAEV,CAAA,CAAA,SACH,CAAA,CACF,CAEJ,QACY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAAA,CAAA,eAGlB,CAAA,CAAA,OAAOgB,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,IAAAA,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';\nimport { createContext, useEffect, useState } from 'react';\nimport 'client-only';\nimport { UNSAFE_PortalProvider } from '@react-aria/overlays';\nimport { useIsSSR } from '@react-aria/ssr';\nimport {\n Tooltip as AriaTooltip,\n TooltipTrigger as AriaTooltipTrigger,\n type ContextValue,\n composeRenderProps,\n Focusable,\n useContextProps,\n} from 'react-aria-components';\nimport { containsExactChildren } from '@/lib/react';\nimport { TooltipStyles } from './styles';\nimport type {\n TooltipBodyProps,\n TooltipProps,\n TooltipTriggerProps,\n} from './types';\n\nexport const TooltipContext =\n createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\n/**\n * Tooltip - A contextual popup component for providing additional information\n *\n * Displays helpful information when users hover over or focus on an element.\n * Provides accessible tooltip functionality with proper positioning, keyboard\n * navigation, and screen reader support for enhanced user experience.\n *\n * @example\n * // Basic tooltip\n * <Tooltip>\n * <Tooltip.Trigger>\n * <Button>Hover me</Button>\n * </Tooltip.Trigger>\n * <Tooltip.Body>\n * This is helpful information\n * </Tooltip.Body>\n * </Tooltip>\n *\n * @example\n * // Tooltip with custom positioning\n * <Tooltip>\n * <Tooltip.Trigger>\n * <Button>Hover for info</Button>\n * </Tooltip.Trigger>\n * <Tooltip.Body placement=\"top\" offset={10}>\n * Positioned above with custom offset\n * </Tooltip.Body>\n * </Tooltip>\n *\n * @example\n * // Icon with tooltip\n * <Tooltip>\n * <Tooltip.Trigger>\n * <Button variant=\"icon\">\n * <Icon><Info /></Icon>\n * </Button>\n * </Tooltip.Trigger>\n * <Tooltip.Body>\n * Additional context for this action\n * </Tooltip.Body>\n * </Tooltip>\n */\nexport function Tooltip({ ref, ...props }: TooltipProps) {\n [props, ref] = useContextProps(props, ref ?? null, TooltipContext);\n\n const { children, delay = 250, ...rest } = props;\n\n containsExactChildren({\n children,\n componentName: Tooltip.displayName,\n restrictions: [\n [TooltipTrigger, { min: 1, max: 1 }],\n [TooltipBody, { min: 1, max: 1 }],\n ],\n });\n\n return (\n <AriaTooltipTrigger {...rest} delay={delay}>\n {children}\n </AriaTooltipTrigger>\n );\n}\nTooltip.displayName = 'Tooltip';\n\nfunction TooltipTrigger({ children, ...props }: TooltipTriggerProps) {\n return <Focusable {...props}>{children}</Focusable>;\n}\nTooltipTrigger.displayName = 'Tooltip.Trigger';\n\nfunction TooltipBody({\n children,\n parentRef,\n className,\n offset = 5,\n placement = 'bottom',\n ...props\n}: TooltipBodyProps) {\n const isSSR = useIsSSR();\n const [portal, setPortal] = useState(isSSR ? null : document.body);\n\n useEffect(() => {\n const node = parentRef?.current;\n // TODO: Ensure proper ssr hydration\n const port = isSSR ? null : document.createElement('div');\n port?.setAttribute('style', 'position: absolute;');\n\n if (node && port) {\n node.appendChild(port);\n\n setPortal(port);\n }\n\n return () => {\n port?.remove();\n\n setPortal(isSSR ? null : document.body);\n };\n }, [isSSR, parentRef]);\n\n return (\n <UNSAFE_PortalProvider getContainer={() => portal}>\n <AriaTooltip\n {...props}\n className={composeRenderProps(className, (className) =>\n TooltipStyles({ className }),\n )}\n offset={offset}\n placement={placement}\n >\n {children}\n </AriaTooltip>\n </UNSAFE_PortalProvider>\n );\n}\nTooltipBody.displayName = 'Tooltip.Body';\n\nTooltip.Trigger = TooltipTrigger;\nTooltip.Body = TooltipBody;\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as tailwind_variants from 'tailwind-variants';
|
|
2
2
|
|
|
3
|
-
declare const TooltipStyles: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "fg-
|
|
3
|
+
declare const TooltipStyles: tailwind_variants.TVReturnType<{} | {} | {}, undefined, "fg-primary-bold flex max-w-[160px] items-center justify-center break-words rounded-small bg-surface-overlay px-s py-xs text-center text-body-xs shadow-elevation-overlay", {} | {}, undefined, tailwind_variants.TVReturnType<unknown, undefined, "fg-primary-bold flex max-w-[160px] items-center justify-center break-words rounded-small bg-surface-overlay px-s py-xs text-center text-body-xs shadow-elevation-overlay", unknown, unknown>>;
|
|
4
4
|
|
|
5
5
|
export { TooltipStyles };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const o=tv({base:"fg-
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const o=tv({base:"fg-primary-bold flex max-w-[160px] items-center justify-center break-words rounded-small bg-surface-overlay px-s py-xs text-center text-body-xs shadow-elevation-overlay"});export{o as TooltipStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tooltip/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAM,CAAA,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tooltip/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAM,CAAA,CAAAA,EAAA,CAAA,CAAA,IAAA,CAAA,0KACP,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 TooltipStyles = tv({\n base: 'fg-primary-bold flex max-w-[160px] items-center justify-center break-words rounded-small bg-surface-overlay px-s py-xs text-center text-body-xs shadow-elevation-overlay',\n});\n"]}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { ComponentPropsWithRef, ComponentProps } from 'react';
|
|
2
2
|
import { TooltipTriggerComponentProps, Focusable, TooltipProps as TooltipProps$1 } from 'react-aria-components';
|
|
3
3
|
|
|
4
|
-
type TooltipBodyProps = TooltipProps$1
|
|
4
|
+
type TooltipBodyProps = TooltipProps$1 & {
|
|
5
|
+
parentRef?: React.RefObject<HTMLElement | null>;
|
|
6
|
+
};
|
|
5
7
|
type TooltipProps = Omit<ComponentPropsWithRef<'div'>, 'className'> & TooltipTriggerComponentProps;
|
|
6
8
|
type TooltipTriggerProps = ComponentProps<typeof Focusable>;
|
|
7
9
|
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { PropsWithChildren } from 'react';
|
|
4
|
+
import { TextProps } from 'react-aria-components';
|
|
5
|
+
import { IconProps } from '../icon/types.js';
|
|
6
|
+
import { TreeProps, TreeItemProps, TreeItemContentProps, TreeContextValue, TreeItemContextValue } from './types.js';
|
|
7
|
+
import '@react-types/shared';
|
|
8
|
+
import 'tailwind-variants';
|
|
9
|
+
import '../../hooks/use-tree/types.js';
|
|
10
|
+
import './styles.js';
|
|
11
|
+
|
|
12
|
+
declare const TreeContext: react.Context<TreeContextValue>;
|
|
13
|
+
declare function Tree<T>({ children, className, disabledKeys: disabledKeysProp, dragAndDropConfig, expandedKeys: expandedKeysProp, items, selectedKeys: selectedKeysProp, showRuleLines, showVisibility, selectionMode, variant, visibleKeys: visibleKeysProp, onVisibilityChange, onSelectionChange, ...rest }: TreeProps<T>): react_jsx_runtime.JSX.Element;
|
|
14
|
+
declare namespace Tree {
|
|
15
|
+
var displayName: string;
|
|
16
|
+
var Item: typeof TreeItem;
|
|
17
|
+
}
|
|
18
|
+
declare const TreeItemContext: react.Context<TreeItemContextValue>;
|
|
19
|
+
declare function TreeItem({ className, id, ...rest }: TreeItemProps): react_jsx_runtime.JSX.Element;
|
|
20
|
+
declare namespace TreeItem {
|
|
21
|
+
var displayName: string;
|
|
22
|
+
var Content: typeof ItemContent;
|
|
23
|
+
var Label: typeof ItemLabel;
|
|
24
|
+
var Description: typeof ItemDescription;
|
|
25
|
+
var PrefixIcon: typeof ItemIcon;
|
|
26
|
+
var Actions: typeof ItemActions;
|
|
27
|
+
}
|
|
28
|
+
declare function ItemContent({ children }: TreeItemContentProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
declare namespace ItemContent {
|
|
30
|
+
var displayName: string;
|
|
31
|
+
}
|
|
32
|
+
declare function ItemLabel({ children, className }: TextProps): react_jsx_runtime.JSX.Element;
|
|
33
|
+
declare namespace ItemLabel {
|
|
34
|
+
var displayName: string;
|
|
35
|
+
}
|
|
36
|
+
declare function ItemDescription({ children, className }: TextProps): react_jsx_runtime.JSX.Element | null;
|
|
37
|
+
declare namespace ItemDescription {
|
|
38
|
+
var displayName: string;
|
|
39
|
+
}
|
|
40
|
+
declare function ItemIcon({ children, className }: IconProps): react_jsx_runtime.JSX.Element;
|
|
41
|
+
declare namespace ItemIcon {
|
|
42
|
+
var displayName: string;
|
|
43
|
+
}
|
|
44
|
+
declare function ItemActions({ children, className, }: PropsWithChildren & {
|
|
45
|
+
className?: string;
|
|
46
|
+
}): react_jsx_runtime.JSX.Element;
|
|
47
|
+
declare namespace ItemActions {
|
|
48
|
+
var displayName: string;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { Tree, TreeContext, TreeItem, TreeItemContext };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {Show,Hide,ChevronDown,ChevronUp,DragVert}from'@accelint/icons';import {createContext,memo,useContext,useMemo}from'react';import {TreeItemContent,TreeItem,composeRenderProps,Text,useDragAndDrop,Tree,DropIndicator}from'react-aria-components';import {Cache}from'./../../hooks/use-tree/actions/cache.js';import {Button}from'../button/index.js';import {Checkbox}from'../checkbox/index.js';import {Icon}from'../icon/index.js';import {Lines}from'../lines/index.js';import {TreeStyles,TreeStylesDefaults}from'./styles.js';const {tree:pe,item:ue,content:ye,display:fe,icon:be,label:ve,actions:Te,spacing:E,description:he,drag:Ie,expansion:Ce,visibility:ge}=TreeStyles(),x=createContext({visibilityComputedKeys:new Set,showRuleLines:true,showVisibility:false,variant:TreeStylesDefaults.variant,isStatic:true,onVisibilityChange:()=>{}}),xe=t=>jsx(DropIndicator,{target:t,className:"border border-highlight-hover"}),we=memo(function({level:s,isLastOfSet:o}){const{showRuleLines:m,variant:r}=useContext(x);return Array.from({length:s}).map((i,n)=>{const a=n===s-1?"branch":"vert",d=o&&n>0?"last":a;return jsx(Lines,{variant:d,size:r==="crammed"?"medium":"large",isVisible:m,className:E({variant:r})},n)})});function H({children:t,className:s,disabledKeys:o,dragAndDropConfig:m,expandedKeys:r,items:i,selectedKeys:n,showRuleLines:a=true,showVisibility:d=true,selectionMode:l="multiple",variant:w=TreeStylesDefaults.variant,visibleKeys:y,onVisibilityChange:K,onSelectionChange:N,...D}){if(i&&(o||r||n||y))throw new Error("Tree should only be controlled with state from either `items` or keys props, not both");if(!!i!=(typeof t=="function"))throw new Error("Tree `items` and node iterator `children` must be used together");const{dragAndDropHooks:V}=useDragAndDrop({renderDropIndicator:xe,getAllowedDropOperations:()=>["move"],getDropOperation:()=>"move",...m}),f=useMemo(()=>i?new Cache([...i]):null,[i]),c=useMemo(()=>f?.getAllNodes(),[f]),{disabledKeys:S,expandedKeys:T,selectedKeys:h,visibleKeys:A,visibilityComputedKeys:I}=useMemo(()=>{const p={disabledKeys:c?new Set:o,expandedKeys:c?new Set:r,selectedKeys:c?new Set:n,visibleKeys:c?new Set:y,visibilityComputedKeys:new Set};return c?c.reduce((b,{key:C,isDisabled:G,isExpanded:J,isSelected:Q,isVisible:X,isVisibleComputed:Y})=>(G&&b.disabledKeys?.add(C),J&&b.expandedKeys?.add(C),Q&&b.selectedKeys?.add(C),X&&b.visibleKeys?.add(C),Y&&b.visibilityComputedKeys.add(C),b),p):p},[c,o,r,n,y]),F=h?p=>{p!=="all"&&N?.(p);}:void 0;return jsx(x.Provider,{value:{disabledKeys:S,expandedKeys:T,selectedKeys:h,showRuleLines:a,showVisibility:d,variant:w,visibleKeys:A,visibilityComputedKeys:I,isStatic:typeof t!="function",onVisibilityChange:K??(()=>{})},children:jsx(Tree,{...D,className:composeRenderProps(s,p=>pe({className:p,variant:w})),disabledKeys:S,dragAndDropHooks:V,expandedKeys:T,items:i,selectedKeys:h,onSelectionChange:F,selectionMode:l,children:t})})}H.displayName="Tree";const z=createContext({isVisible:true,isViewable:true,ancestors:[]});function u({className:t,id:s,...o}){const{visibilityComputedKeys:m,visibleKeys:r,isStatic:i}=useContext(x),{ancestors:n}=useContext(z),a=m?.has(s)||i&&n.every(l=>r?.has(l)),d=r?.has(s);return jsx(z.Provider,{value:{isVisible:d,isViewable:a,ancestors:[...n,s]},children:jsx(TreeItem,{...o,id:s,className:composeRenderProps(t,l=>ue({className:l})),"data-viewable":a||null,"data-visible":d||null})})}u.displayName="Tree.Item";function M({children:t}){const{showVisibility:s,variant:o,visibleKeys:m,onVisibilityChange:r}=useContext(x),{isVisible:i,isViewable:n}=useContext(z),a=o==="cozy"?"medium":"small";return jsx(TreeItemContent,{children:d=>{const{id:l,allowsDragging:w,hasChildItems:y,level:K,selectionBehavior:N,selectionMode:D,state:V,isDisabled:f,isExpanded:c,isSelected:S}=d,T=!(V.collection.getItem(l)?.nextKey||y),h=N==="toggle"&&D!=="none",A=()=>{const I=new Set(m);m?.has(l)?I.delete(l):I.add(l),r?.(I);};return jsx(Icon.Provider,{size:a,children:jsxs("div",{className:ye({variant:o}),"data-last-of-set":T,children:[s&&jsx(Button,{variant:"icon",color:"info",size:a,onPress:A,isDisabled:f,className:ge(),children:jsx(Icon,{children:i?jsx(Show,{}):jsx(Hide,{})})}),K>1&&jsx(we,{level:K,isLastOfSet:T}),y?jsx(Button,{slot:"chevron",variant:"icon",size:a,className:Ce(),children:jsx(Icon,{children:c?jsx(ChevronDown,{}):jsx(ChevronUp,{})})}):jsx("div",{className:E({variant:o})}),jsx("div",{className:fe({variant:o}),children:typeof t=="function"?t({...d,variant:o,isVisible:i,isViewable:n,defaultChildren:null}):t}),h&&jsx(Checkbox,{slot:"selection",isSelected:S,isDisabled:f}),w&&jsx(Button,{slot:"drag",variant:"icon",size:a,isDisabled:f,className:Ie({}),children:jsx(Icon,{children:jsx(DragVert,{})})})]})})}})}M.displayName="Tree.Item.Content";function W({children:t,className:s}){return jsx(Text,{className:ve({className:s}),children:t})}W.displayName="Tree.Item.Label";function U({children:t,className:s}){const{variant:o}=useContext(x);return o!=="crammed"?jsx(Text,{"data-slot":"description",className:he({className:s,variant:o}),children:t}):null}U.displayName="Tree.Item.Description";function _({children:t,className:s}){return jsx(Icon,{className:be({className:s}),children:t})}_.displayName="Tree.Item.PrefixIcon";function q({children:t,className:s}){return jsx("div",{className:Te({className:s}),children:t})}q.displayName="Tree.Icon.Actions",H.Item=u,u.Content=M,u.Label=W,u.Description=U,u.PrefixIcon=_,u.Actions=q;export{H as Tree,x as TreeContext,u as TreeItem,z as TreeItemContext};//# sourceMappingURL=index.js.map
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/index.tsx"],"names":["label","description","drag","expansion","TreeStyles","me","B","target","jsx","e","re","TreeLines","se","showRuleLines","variant","TreeContext","_","i","type","level","Lines","ce","spacing","Tree","children","className","disabledKeysProp","selectionMode","onVisibilityChange","k","onSelectionChange","items","defaultRenderDropIndicator","ae","nodes","P","le","disabledKeys","visibilityComputedKeys","acc","selectedKeysProp","visibleKeysProp","isExpanded","isSelected","isDisabled","key","isVisible","isVisibleComputed","expandedKeysProp","handleSelectionChange","selectedKeys","AriaTree","oe","O","expandedKeys","TreeItem","visibleKeys","isStatic","isViewable","ancestors","v","id","TreeItemContext","rest","item","ie","useContext","renderProps","allowsDragging","ne","state","isLastOfSet","hasChildItems","keys","size","jsxs","g","Ke","Button","handlePress","L","visibility","Hide","te","ee","ChevronUp","$","display","shouldShowSelection","j","ItemLabel","R","ItemDescription","ItemIcon","actions","ItemContent","ItemActions"],"mappings":"mjBAqDEA,MAAAA,CAAAA,IACA,CAAA,EAAA,CAAA,IACA,CAAA,EAAA,CAAA,OACA,CAAA,EAAA,CAAA,OAAAC,CAAAA,EACA,CAAA,IAAAC,CAAAA,EACA,CAAA,KAAA,CAAA,EAAA,CAAAC,OACA,CAAA,EAAA,CAAA,OACEC,CAAAA,CAAAA,CAAW,WAGb,CAAA,EAAA,CAAA,IAAA,CAAA,EAAA,CAAA,SAAwB,CAAA,EAAI,CAAA,UAC5B,CAAA,EAAA,CAAA,CAAAC,UAAe,EACf,CAAA,CA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AA,CAAA,CAAA,CAAUwC,CAAAA,CACnBxC,CAAAA,WACS,CAAA,mBACA,CAAA,CAAA,CAAA,IAAasC,CAAAA,CACtBtC,EAAS,CAAA,OAAUyC,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,WAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,UAAAA,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\nimport { ChevronDown, ChevronUp, DragVert, Hide, Show } from '@accelint/icons';\nimport {\n createContext,\n memo,\n type PropsWithChildren,\n useContext,\n useMemo,\n} from 'react';\nimport {\n Tree as AriaTree,\n TreeItem as AriaTreeItem,\n TreeItemContent as AriaTreeItemContent,\n composeRenderProps,\n DropIndicator,\n type DropTarget,\n Text,\n type TextProps,\n useDragAndDrop,\n} from 'react-aria-components';\nimport { Cache } from '@/hooks/use-tree/actions/cache';\nimport { Button } from '../button';\nimport { Checkbox } from '../checkbox';\nimport { Icon } from '../icon';\nimport { Lines } from '../lines';\nimport { TreeStyles, TreeStylesDefaults } from './styles';\nimport type { Key, Selection } from '@react-types/shared';\nimport type { IconProps } from '../icon/types';\nimport type {\n TreeContextValue,\n TreeItemContentProps,\n TreeItemContextValue,\n TreeItemProps,\n TreeProps,\n} from './types';\n\nconst {\n tree,\n item,\n content,\n display,\n icon,\n label,\n actions,\n spacing,\n description,\n drag,\n expansion,\n visibility,\n} = TreeStyles();\n\nexport const TreeContext = createContext<TreeContextValue>({\n visibilityComputedKeys: new Set(),\n showRuleLines: true,\n showVisibility: false,\n variant: TreeStylesDefaults.variant,\n isStatic: true,\n onVisibilityChange: () => undefined,\n});\n\nconst defaultRenderDropIndicator = (target: DropTarget) => (\n <DropIndicator target={target} className='border border-highlight-hover' />\n);\n\nconst TreeLines = memo(function TreeLines({\n level,\n isLastOfSet,\n}: {\n level: number;\n isLastOfSet: boolean;\n}) {\n const { showRuleLines, variant } = useContext(TreeContext);\n\n return Array.from({ length: level }).map((_, i) => {\n const type = i === level - 1 ? 'branch' : 'vert';\n const line = isLastOfSet && i > 0 ? 'last' : type;\n const size = variant === 'crammed' ? 'medium' : 'large';\n\n return (\n <Lines\n // biome-ignore lint/suspicious/noArrayIndexKey: index should be the key, only count matters\n key={i}\n variant={line}\n size={size}\n isVisible={showRuleLines}\n className={spacing({ variant })}\n />\n );\n });\n});\n\nexport function Tree<T>({\n children,\n className,\n disabledKeys: disabledKeysProp,\n dragAndDropConfig,\n expandedKeys: expandedKeysProp,\n items,\n selectedKeys: selectedKeysProp,\n showRuleLines = true,\n showVisibility = true,\n selectionMode = 'multiple',\n variant = TreeStylesDefaults.variant,\n visibleKeys: visibleKeysProp,\n onVisibilityChange,\n onSelectionChange,\n ...rest\n}: TreeProps<T>) {\n /**\n * A static collection is hard-coded. Dynamic is data-driven from an external source.\n * https://react-spectrum.adobe.com/react-aria/Tree.html#content\n *\n * Controlled state should only be used on a static tree.\n */\n if (\n items &&\n (disabledKeysProp ||\n expandedKeysProp ||\n selectedKeysProp ||\n visibleKeysProp)\n ) {\n throw new Error(\n 'Tree should only be controlled with state from either `items` or keys props, not both',\n );\n }\n\n /**\n * A static tree won't support the node iterator pattern.\n */\n if (!!items !== (typeof children === 'function')) {\n throw new Error(\n 'Tree `items` and node iterator `children` must be used together',\n );\n }\n\n const { dragAndDropHooks } = useDragAndDrop({\n renderDropIndicator: defaultRenderDropIndicator,\n getAllowedDropOperations: () => ['move'],\n getDropOperation: () => 'move',\n ...dragAndDropConfig,\n });\n const cache = useMemo(() => (items ? new Cache([...items]) : null), [items]);\n const nodes = useMemo(() => cache?.getAllNodes(), [cache]);\n const {\n disabledKeys,\n expandedKeys,\n selectedKeys,\n visibleKeys,\n visibilityComputedKeys,\n } = useMemo(() => {\n const acc = {\n disabledKeys: nodes ? new Set<Key>() : disabledKeysProp,\n expandedKeys: nodes ? new Set<Key>() : expandedKeysProp,\n selectedKeys: nodes ? new Set<Key>() : selectedKeysProp,\n visibleKeys: nodes ? new Set<Key>() : visibleKeysProp,\n visibilityComputedKeys: new Set<Key>(),\n };\n\n if (!nodes) {\n return acc;\n }\n\n return nodes.reduce(\n (\n acc,\n {\n key,\n isDisabled,\n isExpanded,\n isSelected,\n isVisible,\n isVisibleComputed,\n },\n ) => {\n if (isDisabled) {\n acc.disabledKeys?.add(key);\n }\n if (isExpanded) {\n acc.expandedKeys?.add(key);\n }\n if (isSelected) {\n acc.selectedKeys?.add(key);\n }\n if (isVisible) {\n acc.visibleKeys?.add(key);\n }\n if (isVisibleComputed) {\n acc.visibilityComputedKeys.add(key);\n }\n return acc;\n },\n acc,\n );\n }, [\n nodes,\n disabledKeysProp,\n expandedKeysProp,\n selectedKeysProp,\n visibleKeysProp,\n ]);\n\n const handleSelectionChange = selectedKeys\n ? (selection: Selection) => {\n if (selection !== 'all') {\n onSelectionChange?.(selection);\n }\n }\n : undefined;\n\n return (\n <TreeContext.Provider\n value={{\n disabledKeys,\n expandedKeys,\n selectedKeys,\n showRuleLines,\n showVisibility,\n variant,\n visibleKeys,\n visibilityComputedKeys,\n isStatic: typeof children !== 'function',\n onVisibilityChange: onVisibilityChange ?? (() => undefined), // TODO: improve\n }}\n >\n <AriaTree\n {...rest}\n className={composeRenderProps(className, (className) =>\n tree({ className, variant }),\n )}\n disabledKeys={disabledKeys}\n dragAndDropHooks={dragAndDropHooks}\n expandedKeys={expandedKeys}\n items={items}\n selectedKeys={selectedKeys}\n onSelectionChange={handleSelectionChange}\n selectionMode={selectionMode}\n >\n {children}\n </AriaTree>\n </TreeContext.Provider>\n );\n}\nTree.displayName = 'Tree';\n\nexport const TreeItemContext = createContext<TreeItemContextValue>({\n isVisible: true,\n isViewable: true,\n ancestors: [],\n});\n\nexport function TreeItem({ className, id, ...rest }: TreeItemProps) {\n const { visibilityComputedKeys, visibleKeys, isStatic } =\n useContext(TreeContext);\n const { ancestors } = useContext(TreeItemContext);\n const isViewable =\n visibilityComputedKeys?.has(id) ||\n (isStatic && ancestors.every((key) => visibleKeys?.has(key)));\n const isVisible = visibleKeys?.has(id);\n\n return (\n <TreeItemContext.Provider\n value={{\n isVisible,\n isViewable,\n ancestors: [...ancestors, id],\n }}\n >\n <AriaTreeItem\n {...rest}\n id={id}\n className={composeRenderProps(className, (className) =>\n item({ className }),\n )}\n data-viewable={isViewable || null}\n data-visible={isVisible || null}\n />\n </TreeItemContext.Provider>\n );\n}\nTreeItem.displayName = 'Tree.Item';\n\nfunction ItemContent({ children }: TreeItemContentProps) {\n const { showVisibility, variant, visibleKeys, onVisibilityChange } =\n useContext(TreeContext);\n const { isVisible, isViewable } = useContext(TreeItemContext);\n const size = variant === 'cozy' ? 'medium' : 'small';\n\n return (\n <AriaTreeItemContent>\n {(renderProps) => {\n const {\n id,\n allowsDragging,\n hasChildItems,\n level,\n selectionBehavior,\n selectionMode,\n state,\n isDisabled,\n isExpanded,\n isSelected,\n } = renderProps;\n\n const isLastOfSet = !(\n state.collection.getItem(id)?.nextKey || hasChildItems\n );\n const shouldShowSelection =\n selectionBehavior === 'toggle' && selectionMode !== 'none';\n\n const handlePress = () => {\n const keys = new Set<Key>(visibleKeys);\n visibleKeys?.has(id) ? keys.delete(id) : keys.add(id);\n onVisibilityChange?.(keys);\n };\n\n return (\n <Icon.Provider size={size}>\n <div\n className={content({ variant })}\n data-last-of-set={isLastOfSet}\n >\n {showVisibility && (\n <Button\n variant='icon'\n color='info'\n size={size}\n onPress={handlePress}\n isDisabled={isDisabled}\n className={visibility()}\n >\n <Icon>{isVisible ? <Show /> : <Hide />}</Icon>\n </Button>\n )}\n {level > 1 && (\n <TreeLines level={level} isLastOfSet={isLastOfSet} />\n )}\n {hasChildItems ? (\n <Button\n slot='chevron'\n variant='icon'\n size={size}\n className={expansion()}\n >\n <Icon>{isExpanded ? <ChevronDown /> : <ChevronUp />}</Icon>\n </Button>\n ) : (\n <div className={spacing({ variant })} />\n )}\n <div className={display({ variant })}>\n {typeof children === 'function'\n ? children({\n ...renderProps,\n variant,\n isVisible,\n isViewable: isViewable,\n defaultChildren: null,\n })\n : children}\n </div>\n {shouldShowSelection && (\n <Checkbox\n slot='selection'\n isSelected={isSelected}\n isDisabled={isDisabled}\n />\n )}\n {allowsDragging && (\n <Button\n slot='drag'\n variant='icon'\n size={size}\n isDisabled={isDisabled}\n className={drag({})}\n >\n <Icon>\n <DragVert />\n </Icon>\n </Button>\n )}\n </div>\n </Icon.Provider>\n );\n }}\n </AriaTreeItemContent>\n );\n}\nItemContent.displayName = 'Tree.Item.Content';\n\nfunction ItemLabel({ children, className }: TextProps) {\n return <Text className={label({ className })}>{children}</Text>;\n}\nItemLabel.displayName = 'Tree.Item.Label';\n\nfunction ItemDescription({ children, className }: TextProps) {\n const { variant } = useContext(TreeContext);\n\n return variant !== 'crammed' ? (\n <Text\n data-slot='description'\n className={description({ className, variant })}\n >\n {children}\n </Text>\n ) : null;\n}\nItemDescription.displayName = 'Tree.Item.Description';\n\nfunction ItemIcon({ children, className }: IconProps) {\n return <Icon className={icon({ className })}>{children}</Icon>;\n}\nItemIcon.displayName = 'Tree.Item.PrefixIcon';\n\nfunction ItemActions({\n children,\n className,\n}: PropsWithChildren & { className?: string }) {\n return <div className={actions({ className })}>{children}</div>;\n}\nItemActions.displayName = 'Tree.Icon.Actions';\n\nTree.Item = TreeItem;\nTreeItem.Content = ItemContent;\nTreeItem.Label = ItemLabel;\nTreeItem.Description = ItemDescription;\nTreeItem.PrefixIcon = ItemIcon;\nTreeItem.Actions = ItemActions;\n"]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as tailwind_variants from 'tailwind-variants';
|
|
2
|
+
|
|
3
|
+
declare const TreeStylesDefaults: {
|
|
4
|
+
readonly variant: "cozy";
|
|
5
|
+
};
|
|
6
|
+
declare const TreeStyles: tailwind_variants.TVReturnType<{
|
|
7
|
+
variant: {
|
|
8
|
+
cozy: {
|
|
9
|
+
content: string;
|
|
10
|
+
display: string;
|
|
11
|
+
label: string;
|
|
12
|
+
actions: string;
|
|
13
|
+
spacing: string;
|
|
14
|
+
item: string;
|
|
15
|
+
};
|
|
16
|
+
compact: {
|
|
17
|
+
content: string;
|
|
18
|
+
display: string;
|
|
19
|
+
label: string;
|
|
20
|
+
actions: string;
|
|
21
|
+
spacing: string;
|
|
22
|
+
item: string;
|
|
23
|
+
};
|
|
24
|
+
crammed: {
|
|
25
|
+
content: string;
|
|
26
|
+
display: string;
|
|
27
|
+
label: string;
|
|
28
|
+
actions: string;
|
|
29
|
+
spacing: string;
|
|
30
|
+
item: string;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
}, {
|
|
34
|
+
tree: string;
|
|
35
|
+
item: string[];
|
|
36
|
+
content: string[];
|
|
37
|
+
display: string;
|
|
38
|
+
icon: string;
|
|
39
|
+
label: string;
|
|
40
|
+
description: string;
|
|
41
|
+
actions: string;
|
|
42
|
+
spacing: string;
|
|
43
|
+
visibility: string[];
|
|
44
|
+
expansion: string[];
|
|
45
|
+
drag: string[];
|
|
46
|
+
}, undefined, {
|
|
47
|
+
variant: {
|
|
48
|
+
cozy: {
|
|
49
|
+
content: string;
|
|
50
|
+
display: string;
|
|
51
|
+
label: string;
|
|
52
|
+
actions: string;
|
|
53
|
+
spacing: string;
|
|
54
|
+
item: string;
|
|
55
|
+
};
|
|
56
|
+
compact: {
|
|
57
|
+
content: string;
|
|
58
|
+
display: string;
|
|
59
|
+
label: string;
|
|
60
|
+
actions: string;
|
|
61
|
+
spacing: string;
|
|
62
|
+
item: string;
|
|
63
|
+
};
|
|
64
|
+
crammed: {
|
|
65
|
+
content: string;
|
|
66
|
+
display: string;
|
|
67
|
+
label: string;
|
|
68
|
+
actions: string;
|
|
69
|
+
spacing: string;
|
|
70
|
+
item: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}, {
|
|
74
|
+
tree: string;
|
|
75
|
+
item: string[];
|
|
76
|
+
content: string[];
|
|
77
|
+
display: string;
|
|
78
|
+
icon: string;
|
|
79
|
+
label: string;
|
|
80
|
+
description: string;
|
|
81
|
+
actions: string;
|
|
82
|
+
spacing: string;
|
|
83
|
+
visibility: string[];
|
|
84
|
+
expansion: string[];
|
|
85
|
+
drag: string[];
|
|
86
|
+
}, tailwind_variants.TVReturnType<{
|
|
87
|
+
variant: {
|
|
88
|
+
cozy: {
|
|
89
|
+
content: string;
|
|
90
|
+
display: string;
|
|
91
|
+
label: string;
|
|
92
|
+
actions: string;
|
|
93
|
+
spacing: string;
|
|
94
|
+
item: string;
|
|
95
|
+
};
|
|
96
|
+
compact: {
|
|
97
|
+
content: string;
|
|
98
|
+
display: string;
|
|
99
|
+
label: string;
|
|
100
|
+
actions: string;
|
|
101
|
+
spacing: string;
|
|
102
|
+
item: string;
|
|
103
|
+
};
|
|
104
|
+
crammed: {
|
|
105
|
+
content: string;
|
|
106
|
+
display: string;
|
|
107
|
+
label: string;
|
|
108
|
+
actions: string;
|
|
109
|
+
spacing: string;
|
|
110
|
+
item: string;
|
|
111
|
+
};
|
|
112
|
+
};
|
|
113
|
+
}, {
|
|
114
|
+
tree: string;
|
|
115
|
+
item: string[];
|
|
116
|
+
content: string[];
|
|
117
|
+
display: string;
|
|
118
|
+
icon: string;
|
|
119
|
+
label: string;
|
|
120
|
+
description: string;
|
|
121
|
+
actions: string;
|
|
122
|
+
spacing: string;
|
|
123
|
+
visibility: string[];
|
|
124
|
+
expansion: string[];
|
|
125
|
+
drag: string[];
|
|
126
|
+
}, undefined, unknown, unknown>>;
|
|
127
|
+
|
|
128
|
+
export { TreeStyles, TreeStylesDefaults };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const t={variant:"cozy"},a=tv({slots:{tree:"overflow-auto outline-hidden",item:["not-visible:fg-primary-muted not-viewable:fg-primary-muted fg-primary-bold px-s","group/tree-item rounded-medium hover:bg-interactive-muted-hover","drop-target:border drop-target:bg-accent-primary-muted/20 drop-target:outline-accent-primary-bold","disabled:cursor-not-allowed disabled:border-none disabled:hover:bg-transparent disabled:data-[drop-target=true]:bg-transparent"],content:["flex items-center justify-items-start px-xs","overflow-x group w-full outline-hidden"],display:'grid flex-1 grid-cols-[auto_auto_1fr_auto] items-center [grid-template-areas:"icon_label_space_action"_"icon_description_space_action"]',icon:"[grid-area:icon]",label:"not-has-[+[data-slot=description]]:row-span-full [grid-area:label]",description:"fg-primary-muted text-body-s [grid-area:description]",actions:"flex shrink-0 items-center [grid-area:action]",spacing:"",visibility:["group-not-visible/tree-item:enabled:color-info:fg-primary-muted","group-not-viewable/tree-item:enabled:color-info:fg-primary-muted fg-primary-bold","fg-primary-bold"],expansion:["group-not-visible/tree-item:enabled:color-info:fg-primary-muted","group-not-viewable/tree-item:enabled:color-info:fg-primary-muted fg-primary-bold","fg-primary-bold"],drag:["group-not-visible/tree-item:enabled:color-info:fg-primary-muted","group-not-viewable/tree-item:enabled:color-info:fg-primary-muted fg-primary-bold","fg-primary-bold"]},variants:{variant:{cozy:{content:"min-h-[48px] text-header-m",display:"gap-x-s px-xs",label:"gap-xs",actions:"gap-x-xs",spacing:"min-h-[46px] w-[28px]",item:"min-h-s"},compact:{content:"min-h-[36px] gap-xs text-header-s",display:"gap-x-s px-xxs",label:"gap-xs",actions:"gap-x-xxs",spacing:"min-h-[38px] w-[20px]",item:"min-h-l"},crammed:{content:"gap-xs text-header-s",display:"gap-x-xs px-xxs",label:"gap-xs",actions:"gap-x-xxs",spacing:"min-h-xl w-[20px]",item:"min-h-s"}}},defaultVariants:t});export{a as TreeStyles,t as TreeStylesDefaults};//# sourceMappingURL=styles.js.map
|
|
2
|
+
//# sourceMappingURL=styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tree/styles.ts"],"names":["TreeStyles","tv","e"],"mappings":"sCAeE,MAAA,CAAS,CAAA,CAAA,OAGEA,CAAaC,SACjB,CACLC,EAAA,CAAA,CAAA,KAAM,CAAA,CAAA,IAAA,CAAA,8BAEJ,CAAA,IAAA,CAAA,CAAA,iFACA,CAAA,iEACA,CAAA,mGACA,CAAA,gIAEO,CACP,CAAA,OAAA,CAAA,CAAA,6CACA,CAAA,wCAGA,CAAA,CAAA,OAAA,CAAA,yIACI,CAAA,IAAA,CAAA,kBACC,CAAA,KAAA,CAAA,gFACM,CAAA,sDACJ,CAAA,OAAA,CAAA,+CACA,CAAA,OACT,CAAA,EAAA,CAAA,UACE,CAAA,CAAA,iEACA,CAAA,kFACA,CAAA,iBAEF,CAAA,CAAW,SACT,CAAA,CAAA,iEACA,CAAA,kFACA,CAAA,iBAGA,CAAA,CAAA,IAAA,CAAA,CAAA,iEACA,CAAA,oGAIJ,CAAA,CAAU,CACR,QAAS,CACP,QACE,CAAA,CAAA,IAAS,CAAA,CAAA,OAAA,CAAA,4BACA,CAAA,OAAA,CAAA,qBAET,CAAA,QAAS,CAAA,OAAA,CAAA,UACA,CAAA,OAAA,CAAA,uBACH,CAAA,IACR,CAAA,SACS,CACP,CAAA,OAAS,CAAA,CAAA,OAAA,CAAA,mCACA,CAAA,OAAA,CAAA,sBAET,CAAA,QAAS,CAAA,OAAA,CAAA,WACA,CAAA,OAAA,CAAA,uBACH,CAAA,IACR,UACS,CACP,CAAA,OAAS,CAAA,CAAA,OAAA,CAAA,sBACA,CAAA,OAAA,CAAA,iBACF,CAAA,KACP,CAAA,QAAS,CAAA,OAAA,CAAA,WACA,CAAA,OAAA,CAAA,mBACH,CAAA,IACR,CACF,SAEF,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 TreeStylesDefaults = {\n variant: 'cozy',\n} as const;\n\nexport const TreeStyles = tv({\n slots: {\n tree: 'overflow-auto outline-hidden',\n item: [\n 'not-visible:fg-primary-muted not-viewable:fg-primary-muted fg-primary-bold px-s',\n 'group/tree-item rounded-medium hover:bg-interactive-muted-hover',\n 'drop-target:border drop-target:bg-accent-primary-muted/20 drop-target:outline-accent-primary-bold',\n 'disabled:cursor-not-allowed disabled:border-none disabled:hover:bg-transparent disabled:data-[drop-target=true]:bg-transparent',\n ],\n content: [\n 'flex items-center justify-items-start px-xs',\n 'overflow-x group w-full outline-hidden',\n ],\n display:\n 'grid flex-1 grid-cols-[auto_auto_1fr_auto] items-center [grid-template-areas:\"icon_label_space_action\"_\"icon_description_space_action\"]',\n icon: '[grid-area:icon]',\n label: 'not-has-[+[data-slot=description]]:row-span-full [grid-area:label]',\n description: 'fg-primary-muted text-body-s [grid-area:description]',\n actions: 'flex shrink-0 items-center [grid-area:action]',\n spacing: '',\n visibility: [\n 'group-not-visible/tree-item:enabled:color-info:fg-primary-muted',\n 'group-not-viewable/tree-item:enabled:color-info:fg-primary-muted fg-primary-bold',\n 'fg-primary-bold',\n ],\n expansion: [\n 'group-not-visible/tree-item:enabled:color-info:fg-primary-muted',\n 'group-not-viewable/tree-item:enabled:color-info:fg-primary-muted fg-primary-bold',\n 'fg-primary-bold',\n ],\n drag: [\n 'group-not-visible/tree-item:enabled:color-info:fg-primary-muted',\n 'group-not-viewable/tree-item:enabled:color-info:fg-primary-muted fg-primary-bold',\n 'fg-primary-bold',\n ],\n },\n variants: {\n variant: {\n cozy: {\n content: 'min-h-[48px] text-header-m',\n display: 'gap-x-s px-xs',\n label: 'gap-xs',\n actions: 'gap-x-xs',\n spacing: 'min-h-[46px] w-[28px]',\n item: 'min-h-s',\n },\n compact: {\n content: 'min-h-[36px] gap-xs text-header-s',\n display: 'gap-x-s px-xxs',\n label: 'gap-xs',\n actions: 'gap-x-xxs',\n spacing: 'min-h-[38px] w-[20px]',\n item: 'min-h-l',\n },\n crammed: {\n content: 'gap-xs text-header-s',\n display: 'gap-x-xs px-xxs',\n label: 'gap-xs',\n actions: 'gap-x-xxs',\n spacing: 'min-h-xl w-[20px]',\n item: 'min-h-s',\n },\n },\n },\n defaultVariants: TreeStylesDefaults,\n});\n"]}
|