@accelint/design-toolkit 3.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.d.ts +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.d.ts +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.d.ts +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.d.ts +3 -3
- 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.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.d.ts +4 -4
- 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.d.ts +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.d.ts +3 -3
- 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.d.ts +1 -3
- 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 +41 -51
- package/dist/components/date-field/styles.js +1 -1
- package/dist/components/date-field/styles.js.map +1 -1
- package/dist/components/date-field/types.d.ts +12 -15
- 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.d.ts +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.d.ts +28 -38
- package/dist/components/dialog/index.js +1 -1
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/dialog/styles.d.ts +60 -0
- package/dist/components/dialog/styles.js +2 -0
- package/dist/components/dialog/styles.js.map +1 -0
- package/dist/components/dialog/types.d.ts +14 -0
- package/dist/components/dialog/types.js +2 -0
- package/dist/components/dialog/types.js.map +1 -0
- 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.d.ts +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.d.ts +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/icon/styles.d.ts +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.d.ts +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.d.ts +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.d.ts +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.d.ts +3 -3
- package/dist/components/options/styles.js +1 -1
- package/dist/components/options/styles.js.map +1 -1
- package/dist/components/options/types.d.ts +1 -1
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/popover/styles.d.ts +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.d.ts +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.d.ts +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.d.ts +4 -4
- 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.d.ts +4 -43
- package/dist/components/slider/index.js +1 -1
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/styles.d.ts +84 -0
- package/dist/components/slider/styles.js +2 -0
- package/dist/components/slider/styles.js.map +1 -0
- package/dist/components/slider/types.d.ts +22 -0
- package/dist/components/slider/types.js +2 -0
- package/dist/components/slider/types.js.map +1 -0
- package/dist/components/switch/index.d.ts +1 -1
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/switch/styles.d.ts +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.d.ts +4 -4
- 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.d.ts +4 -4
- 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 +12 -18
- package/dist/index.d.ts +35 -8
- 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 +15 -5
- 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 +2071 -1007
- package/dist/tokens/themes.css +741 -53
- package/dist/tokens/tokens.css +133 -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 +19 -1
- package/package.json +20 -9
- package/dist/tokens/index.d.ts +0 -123
- package/dist/tokens/index.js +0 -2
- package/dist/tokens/index.js.map +0 -1
|
@@ -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 { SwitchProps } from './types.js';
|
|
6
6
|
|
|
7
7
|
declare const SwitchContext: react.Context<ContextValue<SwitchProps, HTMLLabelElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/switch/index.tsx"],"names":["SwitchStyles","SwitchContext","createContext","h","props","r","SwitchProvider","ref","useContextProps","rest","w","classNames","switchClassNames","children","jsxs","Fragment","y","v","jsx","Switch"],"mappings":"6NA0BQ,MAAA,CAAA,MAA0B,CAAA,CAAA,CAAA,OAAS,CAAA,CAAA,CAAA,KAAUA,CAAAA,CAAa,EAErDC,YAAAA,EACXC,CAA2D,CAAA,CAAAC,aAAA,CAAI,eAEvC,CAAA,CAAA,CAAA,UAAaC,CAAM,GAC3C,CAAA,CAAA,CAAA,CAAA,OACiBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE3C,CACAC,EAAe,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,iBAsCtB,CAAA,SAAkB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACrC,CAACA,EAAOG,CAAG,CAAA,CAAIC,EAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,CAAA,CAAA,CAAA,CAAA,KAAQ,CAAA,qBAAsB,CAAA,CAAA,CAAA,aAAgB,CAAA,CAAA,CAAA,KAAUE,CAAK,GAAIL,CAEjE,CAAA,CAAA,CAAA,CAAA,OACGC,GACE,CAAAK,MAAA,CAAGD,CAAAA,KACCF,GACL,CAAA,CAAA,CAAA,SAA8BI,CAAAA,kBAAY,UACxCC,CAAAA,CAAiB,EAAE,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,aAChC,EAEC,CAAA,CAAA,CAAA,CAAA,QAAmBC,CAAWA,kBAAAA,CAAAA,CAC7BC,EAAAC,EAAAC,IACE,CAAAC,QAAA,CAAA,CAAA,QAAC,YAAK,CAAA,CAAA,SAAqB,CAAA,CAAA,CAAA,CAAA,SAAuB,CAAA,CAAA,EAAA,OAAY,CAC7DJ,GACCK,CAAAA,CAAC,EAAAb,GAAA,CAAA,MAAK,CAAA,CAAA,SAAmB,CAAA,CAAA,CAAA,CAAA,SAAuB,CAAA,CAAA,EAAA,KAC7C,CAAA,CAAA,CAAA,QACH,CAAA,CAEJ,CACD,EACH,CAEJ,CACAc,EAAO,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,QACd,CAAA,CAAA,CAAA,QAAWb,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
|
|
1
|
+
{"version":3,"sources":["../../../src/components/switch/index.tsx"],"names":["SwitchStyles","SwitchContext","createContext","h","props","r","SwitchProvider","ref","useContextProps","rest","w","classNames","switchClassNames","children","jsxs","Fragment","y","v","jsx","Switch"],"mappings":"6NA0BQ,MAAA,CAAA,MAA0B,CAAA,CAAA,CAAA,OAAS,CAAA,CAAA,CAAA,KAAUA,CAAAA,CAAa,EAErDC,YAAAA,EACXC,CAA2D,CAAA,CAAAC,aAAA,CAAI,eAEvC,CAAA,CAAA,CAAA,UAAaC,CAAM,GAC3C,CAAA,CAAA,CAAA,CAAA,OACiBC,GAAA,CAAA,CAAA,CAAA,QAAS,CAAA,CAAA,KAAe,CAAA,CAAA,CAAA,QAE3C,CACAC,EAAe,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,iBAsCtB,CAAA,SAAkB,CAAA,CAAA,CAAAC,GAAK,CAAA,CAAGH,CAAM,GACrC,CAACA,EAAOG,CAAG,CAAA,CAAIC,EAAgBJ,CAAAA,CAAOG,eAAAA,CAAAA,CAAO,CAAA,CAAA,EAAA,IAE7C,CAAA,CAAA,CAAA,CAAA,KAAQ,CAAA,qBAAsB,CAAA,CAAA,CAAA,aAAgB,CAAA,CAAA,CAAA,KAAUE,CAAK,GAAIL,CAEjE,CAAA,CAAA,CAAA,CAAA,OACGC,GACE,CAAAK,MAAA,CAAGD,CAAAA,KACCF,GACL,CAAA,CAAA,CAAA,SAA8BI,CAAAA,kBAAY,UACxCC,CAAAA,CAAiB,EAAE,CAAA,CAAA,CAAA,SAAW,CAAA,CAAA,CAAA,aAChC,EAEC,CAAA,CAAA,CAAA,CAAA,QAAmBC,CAAWA,kBAAAA,CAAAA,CAC7BC,EAAAC,EAAAC,IACE,CAAAC,QAAA,CAAA,CAAA,QAAC,YAAK,CAAA,CAAA,SAAqB,CAAA,CAAA,CAAA,CAAA,SAAuB,CAAA,CAAA,EAAA,OAAY,CAC7DJ,GACCK,CAAAA,CAAC,EAAAb,GAAA,CAAA,MAAK,CAAA,CAAA,SAAmB,CAAA,CAAA,CAAA,CAAA,SAAuB,CAAA,CAAA,EAAA,KAC7C,CAAA,CAAA,CAAA,QACH,CAAA,CAEJ,CACD,EACH,CAEJ,CACAc,EAAO,CAAA,CAAA,CAAA,CAAA,WAAc,CAAA,QACd,CAAA,CAAA,CAAA,QAAWb,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 Switch as AriaSwitch,\n type ContextValue,\n composeRenderProps,\n useContextProps,\n} from 'react-aria-components';\nimport { SwitchStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { SwitchProps } from './types';\n\n// \"switch\" is a reserved term in JS\nconst { switch: switchClassNames, control, label } = SwitchStyles();\n\nexport const SwitchContext =\n createContext<ContextValue<SwitchProps, HTMLLabelElement>>(null);\n\nfunction SwitchProvider({ children, ...props }: ProviderProps<SwitchProps>) {\n return (\n <SwitchContext.Provider value={props}>{children}</SwitchContext.Provider>\n );\n}\nSwitchProvider.displayName = 'Switch.Provider';\n\n/**\n * Switch - A toggle control for binary state changes\n *\n * Provides an accessible toggle switch component for enabling/disabling features\n * or settings. Offers clear visual feedback for on/off states with smooth transitions\n * and proper keyboard and screen reader support.\n *\n * @example\n * // Basic switch\n * <Switch>Enable notifications</Switch>\n *\n * @example\n * // Controlled switch\n * <Switch\n * isSelected={isEnabled}\n * onChange={setIsEnabled}\n * >\n * Dark mode\n * </Switch>\n *\n * @example\n * // Switch with default state\n * <Switch defaultSelected>\n * Auto-save documents\n * </Switch>\n *\n * @example\n * // Disabled switch\n * <Switch isDisabled>\n * Premium feature (upgrade required)\n * </Switch>\n *\n * @example\n * // Switch without label (icon-only)\n * <Switch aria-label=\"Toggle sidebar\" />\n */\nexport function Switch({ ref, ...props }: SwitchProps) {\n [props, ref] = useContextProps(props, ref ?? null, SwitchContext);\n\n const { children, classNames, labelPosition = 'end', ...rest } = props;\n\n return (\n <AriaSwitch\n {...rest}\n ref={ref}\n className={composeRenderProps(classNames?.switch, (className) =>\n switchClassNames({ className, labelPosition }),\n )}\n >\n {composeRenderProps(children, (children) => (\n <>\n <span className={control({ className: classNames?.control })} />\n {children && (\n <span className={label({ className: classNames?.label })}>\n {children}\n </span>\n )}\n </>\n ))}\n </AriaSwitch>\n );\n}\nSwitch.displayName = 'Switch';\nSwitch.Provider = SwitchProvider;\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {tv}from'./../../lib/utils.js';const
|
|
1
|
+
import {tv}from'./../../lib/utils.js';const t=tv({slots:{switch:"group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed",control:["flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-info-bold","group-enabled/switch:group-focus-visible/switch:bg-interactive-muted-hover group-enabled/switch:group-focus-visible/switch:outline-interactive-hover group-enabled/switch:group-focus-visible/switch:before:bg-interactive-bold-hover","group-enabled/switch:group-hover/switch:bg-interactive-muted-hover group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-bold-hover","group-enabled/switch:group-selected/switch:outline-accent-primary-bold group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-accent-primary-bold","group-enabled/switch:group-selected/switch:group-focus-visible/switch:bg-accent-primary-muted group-enabled/switch:group-selected/switch:group-focus-visible/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus-visible/switch:before:bg-accent-primary-bold","group-enabled/switch:group-selected/switch:group-hover/switch:bg-accent-primary-muted group-enabled/switch:group-selected/switch:group-hover/switch:outline-accent-primary-bold group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-accent-primary-bold","group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-interactive-disabled"],label:["fg-primary-bold text-body-s","group-disabled/switch:fg-disabled"]},variants:{labelPosition:{start:{switch:"flex-row-reverse"},end:{switch:"flex-row"}}}});export{t as SwitchStyles};//# sourceMappingURL=styles.js.map
|
|
2
2
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,SACE,CAAA,CAAA,MAAA,CAAA,iFAEA,CAAA,OAAA,CAAA,CAAA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/switch/styles.ts"],"names":["e"],"mappings":"sCAeE,MAAA,CAAO,CACLA,SACE,CAAA,CAAA,MAAA,CAAA,iFAEA,CAAA,OAAA,CAAA,CAAA,oJACA,CAAA,ubAEA,CAAA,qNACA,CAAA,ijBAEA,CAAA,uJAEM,CAAA,CAAA,KAAA,CAAA,CAAA,mEAEA,CACR,QAAA,CAAA,CAAA,oBAEY,CAAA,CAAA,MAAA,CAAA,kBAGR,CAAA,CAAA,YACF,UAGL,CAAA,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 SwitchStyles = tv({\n slots: {\n switch:\n 'group/switch flex cursor-pointer items-center gap-s disabled:cursor-not-allowed',\n control: [\n 'flex rounded-round bg-transparent p-xxs outline outline-interactive before:mr-l before:block before:size-m before:rounded-full before:bg-info-bold',\n 'group-enabled/switch:group-focus-visible/switch:bg-interactive-muted-hover group-enabled/switch:group-focus-visible/switch:outline-interactive-hover group-enabled/switch:group-focus-visible/switch:before:bg-interactive-bold-hover',\n 'group-enabled/switch:group-hover/switch:bg-interactive-muted-hover group-enabled/switch:group-hover/switch:outline-interactive-hover group-enabled/switch:group-hover/switch:before:bg-interactive-bold-hover',\n 'group-enabled/switch:group-selected/switch:outline-accent-primary-bold group-selected/switch:before:mr-0 group-selected/switch:before:ml-l group-enabled/switch:group-selected/switch:before:bg-accent-primary-bold',\n 'group-enabled/switch:group-selected/switch:group-focus-visible/switch:bg-accent-primary-muted group-enabled/switch:group-selected/switch:group-focus-visible/switch:outline-interactive-hover group-enabled/switch:group-selected/switch:group-focus-visible/switch:before:bg-accent-primary-bold',\n 'group-enabled/switch:group-selected/switch:group-hover/switch:bg-accent-primary-muted group-enabled/switch:group-selected/switch:group-hover/switch:outline-accent-primary-bold group-enabled/switch:group-selected/switch:group-hover/switch:before:bg-accent-primary-bold',\n 'group-disabled/switch:bg-interactive-disabled group-disabled/switch:outline-interactive-disabled group-disabled/switch:before:bg-interactive-disabled',\n ],\n label: ['fg-primary-bold text-body-s', 'group-disabled/switch:fg-disabled'],\n },\n variants: {\n labelPosition: {\n start: {\n switch: 'flex-row-reverse',\n },\n end: {\n switch: 'flex-row',\n },\n },\n },\n});\n"]}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import * as react from 'react';
|
|
3
|
+
import { TabListProps, TabProps, TabPanelProps, ContextValue } from 'react-aria-components';
|
|
4
|
+
import { ProviderProps } from '../../lib/types.js';
|
|
5
|
+
import { TabsProps } from './types.js';
|
|
3
6
|
|
|
4
|
-
|
|
7
|
+
declare const TabsContext: react.Context<ContextValue<TabsProps, HTMLDivElement>>;
|
|
8
|
+
declare function TabsProvider({ children, ...props }: ProviderProps<TabsProps>): react_jsx_runtime.JSX.Element;
|
|
9
|
+
declare namespace TabsProvider {
|
|
10
|
+
var displayName: string;
|
|
11
|
+
}
|
|
12
|
+
declare function Tab({ children, className, ...rest }: TabProps): react_jsx_runtime.JSX.Element;
|
|
13
|
+
declare namespace Tab {
|
|
14
|
+
var displayName: string;
|
|
15
|
+
}
|
|
16
|
+
declare function TabList<T extends object>({ children, className, ...rest }: TabListProps<T>): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare namespace TabList {
|
|
18
|
+
var displayName: string;
|
|
19
|
+
}
|
|
20
|
+
declare function TabPanel({ children, className, ...rest }: TabPanelProps): react_jsx_runtime.JSX.Element;
|
|
21
|
+
declare namespace TabPanel {
|
|
22
|
+
var displayName: string;
|
|
5
23
|
}
|
|
6
24
|
/**
|
|
7
25
|
* Tabs - A tab navigation component for organizing content into sections
|
|
@@ -14,9 +32,9 @@ interface TabsProps extends TabsProps$1 {
|
|
|
14
32
|
* // Basic horizontal tabs
|
|
15
33
|
* <Tabs>
|
|
16
34
|
* <Tabs.List>
|
|
17
|
-
* <Tabs.Tab id="overview">Overview</Tabs.Tab>
|
|
18
|
-
* <Tabs.Tab id="details">Details</Tabs.Tab>
|
|
19
|
-
* <Tabs.Tab id="settings">Settings</Tabs.Tab>
|
|
35
|
+
* <Tabs.List.Tab id="overview">Overview</Tabs.List.Tab>
|
|
36
|
+
* <Tabs.List.Tab id="details">Details</Tabs.List.Tab>
|
|
37
|
+
* <Tabs.List.Tab id="settings">Settings</Tabs.List.Tab>
|
|
20
38
|
* </Tabs.List>
|
|
21
39
|
* <Tabs.Panel id="overview">Overview content</Tabs.Panel>
|
|
22
40
|
* <Tabs.Panel id="details">Details content</Tabs.Panel>
|
|
@@ -27,8 +45,8 @@ interface TabsProps extends TabsProps$1 {
|
|
|
27
45
|
* // Vertical tabs
|
|
28
46
|
* <Tabs orientation="vertical">
|
|
29
47
|
* <Tabs.List>
|
|
30
|
-
* <Tabs.Tab id="profile">Profile</Tabs.Tab>
|
|
31
|
-
* <Tabs.Tab id="account">Account</Tabs.Tab>
|
|
48
|
+
* <Tabs.List.Tab id="profile">Profile</Tabs.List.Tab>
|
|
49
|
+
* <Tabs.List.Tab id="account">Account</Tabs.List.Tab>
|
|
32
50
|
* </Tabs.List>
|
|
33
51
|
* <Tabs.Panel id="profile">Profile settings</Tabs.Panel>
|
|
34
52
|
* <Tabs.Panel id="account">Account settings</Tabs.Panel>
|
|
@@ -38,42 +56,25 @@ interface TabsProps extends TabsProps$1 {
|
|
|
38
56
|
* // Icon tabs
|
|
39
57
|
* <Tabs>
|
|
40
58
|
* <Tabs.List variant="icons">
|
|
41
|
-
* <Tabs.Tab id="home">
|
|
59
|
+
* <Tabs.List.Tab id="home">
|
|
42
60
|
* <Icon><Home /></Icon>
|
|
43
|
-
* </Tabs.Tab>
|
|
44
|
-
* <Tabs.Tab id="search">
|
|
61
|
+
* </Tabs.List.Tab>
|
|
62
|
+
* <Tabs.List.Tab id="search">
|
|
45
63
|
* <Icon><Search /></Icon>
|
|
46
|
-
* </Tabs.Tab>
|
|
64
|
+
* </Tabs.List.Tab>
|
|
47
65
|
* </Tabs.List>
|
|
48
66
|
* <Tabs.Panel id="home">Home content</Tabs.Panel>
|
|
49
67
|
* <Tabs.Panel id="search">Search content</Tabs.Panel>
|
|
50
68
|
* </Tabs>
|
|
51
69
|
*/
|
|
52
|
-
declare
|
|
53
|
-
|
|
54
|
-
displayName: string;
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
};
|
|
59
|
-
Tab: {
|
|
60
|
-
({ id, children, className, isDisabled, ...rest }: TabProps): react_jsx_runtime.JSX.Element;
|
|
61
|
-
displayName: string;
|
|
70
|
+
declare function Tabs({ ref, ...props }: TabsProps): react_jsx_runtime.JSX.Element;
|
|
71
|
+
declare namespace Tabs {
|
|
72
|
+
var displayName: string;
|
|
73
|
+
var Provider: typeof TabsProvider;
|
|
74
|
+
var List: typeof TabList & {
|
|
75
|
+
Tab: typeof Tab;
|
|
62
76
|
};
|
|
63
|
-
Panel:
|
|
64
|
-
({ id, children, className, ...rest }: TabPanelProps): react_jsx_runtime.JSX.Element;
|
|
65
|
-
displayName: string;
|
|
66
|
-
};
|
|
67
|
-
};
|
|
68
|
-
interface TabListProps extends TabListProps$1<object> {
|
|
69
|
-
/** Whether the tabs are displaying iconography or text. */
|
|
70
|
-
variant?: 'default' | 'icons';
|
|
71
|
-
/** Whether the tabs are used as drawer controls. */
|
|
72
|
-
drawer?: 'left' | 'right' | 'top' | 'bottom';
|
|
73
|
-
}
|
|
74
|
-
interface TabProps extends TabProps$1 {
|
|
75
|
-
}
|
|
76
|
-
interface TabPanelProps extends TabPanelProps$1 {
|
|
77
|
+
var Panel: typeof TabPanel;
|
|
77
78
|
}
|
|
78
79
|
|
|
79
|
-
export {
|
|
80
|
+
export { Tabs, TabsContext };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import'client-only';import {createContext}from'react';import {Tab,composeRenderProps,useContextProps,Tabs,TabPanel,TabList}from'react-aria-components';import {containsExactChildren}from'./../../lib/react.js';import {TabStyles}from'./styles.js';const {tabs:v,list:A,tab:C,panel:E}=TabStyles(),l=createContext(null);function m({children:a,...s}){return jsx(l.Provider,{value:s,children:a})}m.displayName="Tabs.Provider";function b({children:a,className:s,...e}){return jsx(Tab,{...e,className:composeRenderProps(s,t=>C({className:t})),children:a})}b.displayName="Tabs.List.Tab";function n({children:a,className:s,...e}){return containsExactChildren({children:a,componentName:n.displayName,restrictions:[[b,{min:1}]]}),jsx(TabList,{...e,className:composeRenderProps(s,t=>A({className:t})),children:a})}n.displayName="Tabs.List";function T({children:a,className:s,...e}){return jsx(TabPanel,{...e,className:composeRenderProps(s,t=>E({className:t})),children:a})}T.displayName="Tabs.Panel";function r({ref:a,...s}){[s,a]=useContextProps(s,a??null,l);const{children:e,className:t,...P}=s;return containsExactChildren({children:e,componentName:r.displayName,restrictions:[[n,{min:1,max:1}],[T,{min:1}]]}),jsx(Tabs,{...P,ref:a,className:composeRenderProps(t,c=>v({className:c})),children:e})}r.displayName="Tabs",r.Provider=m,r.List=n,r.List.Tab=b,r.Panel=T;export{r as Tabs,l as TabsContext};//# sourceMappingURL=index.js.map
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/tabs/index.tsx"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/tabs/index.tsx"],"names":["list","tab","panel","TabsContext","x","y","props","jsx","o","TabsProvider","className","AriaTab","d","i","children","Tab","containsExactChildren","p","TabList","AriaTabList","rest","AriaTabPanel","N","TabPanel","useContextProps","ref","L","Tabs","AriaTabs","f","composeRenderProps"],"mappings":"wRAiCcA,MAAAA,CAAM,IAAAC,CAAAA,CAAK,CAAA,IAAA,CAAAC,CAAM,IAAc,CAAA,CAEhCC,CAAAA,KAC4C,CAAA,CAAI,CAAA,CAE7DC,SAAA,EAAA,CAAA,CAAA,CAAAC,aAAA,CAAA,IAAwB,EAAA,SAAU,CAAA,CAAA,CAAGC,QACnC,CAAA,CAAA,CAAOC,IAAa,CAAA,CAAA,CAAA,OAASC,GAAA,CAAA,CAAA,CAAA,eAAwB,CACvD,CACAC,CAAAA,aAA2B,CAAA,CAAA,WAAA,CAAA,eAEZ,CAAA,SAAU,CAAA,CAAA,CAAA,QAAAC,CAAW,WAClC,CAAA,CAAA,CACEH,GAACI,CAAA,CACE,CAAA,CAAA,OACDH,GAAA,CAAAI,GAAA,CAAA,CAAA,GAA8BF,CAAAA,CAAYA,SAClC,CAAAG,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAC,CACnB,CAAA,SAEC,CAAAC,CAAAA,CACH,CAEJ,CACAC,CAAAA,QAAI,CAAA,CAAA,CAAA,CAAA,CAAc,6BAGhB,CAAA,SACA,CAAA,CAAA,CAAA,QAAAL,CACA,CAAA,CAAA,SAEA,CAAA,CAAA,CAAAM,GACE,CAAA,CAAA,CAAA,CAAA,OACAC,qBAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAeC,aAAQ,CACvB,CAAA,CAAA,WAAc,CAAC,YACjB,CAAC,CAAA,CAGCX,EAACY,CAAAA,GACE,CAAA,CAAGC,CAAAA,CACJ,oBAA8BV,CAAAA,CAAYA,SACjC,CAAAG,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAC,CACpB,CAAA,SAEC,CAAAC,CAAAA,CACH,CAEJ,CACAI,CAAAA,QAAQ,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,uBAEF,CAAA,SAAU,CAAA,CAAA,CAAA,QAAAR,CAAW,CAAA,CAAA,SACvC,CAAA,CAAA,CACEH,GAACc,CAAA,CACE,CAAA,CAAA,OACDb,GAAA,CAAAc,QAAA,CAAA,CAAA,GAA8BZ,CAAAA,CAAYA,SAChC,CAAAG,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAC,CACrB,UAEC,CAAAC,CAAAA,CACH,CAEJ,CACAS,CAAAA,QAAS,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WAgDhB,CAAA,YAAgB,CAAA,SAAc,CAAc,CACjD,CAACjB,GAAU,CAAA,CAAIkB,CAAAA,GAAuBC,GAAO,CAAA,CAAA,CAAA,CAAA,CAAMtB,CAAW,CAAAuB,eAE9D,CAAA,CAAA,CAAA,CAAA,EAAQ,IAAA,CAAA,CAAA,CAAA,CAAA,KAAU,CAAA,QAAAhB,CAAW,CAAA,CAAA,eAEP,CACpB,CAAA,CAAA,CAAA,CAAA,OACAO,qBAAA,CAAA,CAAA,QAAA,CAAA,CAAA,CAAeU,aAAK,CACpB,CAAA,CAAA,WAAc,CACZ,YAAoB,CAAA,CAAK,CAAE,CAAC,EAC5B,GAAW,CAAE,CAAA,CAAA,GAAO,CAAC,CACvB,CACF,CAAC,CAAA,CAGCpB,CAAAA,CAACqB,CAAAA,GACE,CAAA,CAAGR,CAAAA,CACJ,CAAA,CAAA,CAAA,CAAKK,GAAAA,CACLI,cAAWC,CAAmBpB,CAAAA,CAAYA,SACjC,CAAAG,kBAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAC,CACpB,CAAA,SAEC,CAAAC,CAAAA,CACH,CAEJ,CACAa,CAAAA,QAAK,CAAA,CAAA,CAAA,CAAA,CAAc,CAAA,CAAA,WACd,CAAA,MAELA,CAAAA,CAAK,CAAA,QACA,CAAA,CAAA,CAAA,CAAA,CAAK,IAAMZ,CAAAA,CAChBY,EAAK,CAAA,IAAA,CAAQJ,GAAAA,CAAAA,CAAAA,CAAAA,CAAAA,CAAAA,KAAAA,CAAAA,CAAAA","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n'use client';\n\nimport 'client-only';\nimport { createContext } from 'react';\nimport {\n Tab as AriaTab,\n TabList as AriaTabList,\n TabPanel as AriaTabPanel,\n Tabs as AriaTabs,\n type ContextValue,\n composeRenderProps,\n type TabListProps,\n type TabPanelProps,\n type TabProps,\n useContextProps,\n} from 'react-aria-components';\nimport { containsExactChildren } from '@/lib/react';\nimport { TabStyles } from './styles';\nimport type { ProviderProps } from '@/lib/types';\nimport type { TabsProps } from './types';\n\nconst { tabs, list, tab, panel } = TabStyles();\n\nexport const TabsContext =\n createContext<ContextValue<TabsProps, HTMLDivElement>>(null);\n\nfunction TabsProvider({ children, ...props }: ProviderProps<TabsProps>) {\n return <TabsContext.Provider value={props}>{children}</TabsContext.Provider>;\n}\nTabsProvider.displayName = 'Tabs.Provider';\n\nfunction Tab({ children, className, ...rest }: TabProps) {\n return (\n <AriaTab\n {...rest}\n className={composeRenderProps(className, (className) =>\n tab({ className }),\n )}\n >\n {children}\n </AriaTab>\n );\n}\nTab.displayName = 'Tabs.List.Tab';\n\nfunction TabList<T extends object>({\n children,\n className,\n ...rest\n}: TabListProps<T>) {\n containsExactChildren({\n children,\n componentName: TabList.displayName,\n restrictions: [[Tab, { min: 1 }]],\n });\n\n return (\n <AriaTabList<T>\n {...rest}\n className={composeRenderProps(className, (className) =>\n list({ className }),\n )}\n >\n {children}\n </AriaTabList>\n );\n}\nTabList.displayName = 'Tabs.List';\n\nfunction TabPanel({ children, className, ...rest }: TabPanelProps) {\n return (\n <AriaTabPanel\n {...rest}\n className={composeRenderProps(className, (className) =>\n panel({ className }),\n )}\n >\n {children}\n </AriaTabPanel>\n );\n}\nTabPanel.displayName = 'Tabs.Panel';\n\n/**\n * Tabs - A tab navigation component for organizing content into sections\n *\n * Provides accessible tab navigation with keyboard support and proper ARIA implementation.\n * Supports both horizontal and vertical orientations with icon and text variants.\n * Perfect for organizing related content into separate, focusable sections.\n *\n * @example\n * // Basic horizontal tabs\n * <Tabs>\n * <Tabs.List>\n * <Tabs.List.Tab id=\"overview\">Overview</Tabs.List.Tab>\n * <Tabs.List.Tab id=\"details\">Details</Tabs.List.Tab>\n * <Tabs.List.Tab id=\"settings\">Settings</Tabs.List.Tab>\n * </Tabs.List>\n * <Tabs.Panel id=\"overview\">Overview content</Tabs.Panel>\n * <Tabs.Panel id=\"details\">Details content</Tabs.Panel>\n * <Tabs.Panel id=\"settings\">Settings content</Tabs.Panel>\n * </Tabs>\n *\n * @example\n * // Vertical tabs\n * <Tabs orientation=\"vertical\">\n * <Tabs.List>\n * <Tabs.List.Tab id=\"profile\">Profile</Tabs.List.Tab>\n * <Tabs.List.Tab id=\"account\">Account</Tabs.List.Tab>\n * </Tabs.List>\n * <Tabs.Panel id=\"profile\">Profile settings</Tabs.Panel>\n * <Tabs.Panel id=\"account\">Account settings</Tabs.Panel>\n * </Tabs>\n *\n * @example\n * // Icon tabs\n * <Tabs>\n * <Tabs.List variant=\"icons\">\n * <Tabs.List.Tab id=\"home\">\n * <Icon><Home /></Icon>\n * </Tabs.List.Tab>\n * <Tabs.List.Tab id=\"search\">\n * <Icon><Search /></Icon>\n * </Tabs.List.Tab>\n * </Tabs.List>\n * <Tabs.Panel id=\"home\">Home content</Tabs.Panel>\n * <Tabs.Panel id=\"search\">Search content</Tabs.Panel>\n * </Tabs>\n */\nexport function Tabs({ ref, ...props }: TabsProps) {\n [props, ref] = useContextProps(props, ref ?? null, TabsContext);\n\n const { children, className, ...rest } = props;\n\n containsExactChildren({\n children,\n componentName: Tabs.displayName,\n restrictions: [\n [TabList, { min: 1, max: 1 }],\n [TabPanel, { min: 1 }],\n ],\n });\n\n return (\n <AriaTabs\n {...rest}\n ref={ref}\n className={composeRenderProps(className, (className) =>\n tabs({ className }),\n )}\n >\n {children}\n </AriaTabs>\n );\n}\nTabs.displayName = 'Tabs';\nTabs.Provider = TabsProvider;\n// biome-ignore lint/style/useNamingConvention: Component name\nTabs.List = TabList as typeof TabList & { Tab: typeof Tab };\nTabs.List.Tab = Tab;\nTabs.Panel = TabPanel;\n"]}
|
|
@@ -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":"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","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":"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","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"]}
|
|
@@ -4,9 +4,9 @@ import * as tailwind_merge from 'tailwind-merge';
|
|
|
4
4
|
declare const TextAreaStyles: tailwind_variants.TVReturnType<{
|
|
5
5
|
[key: string]: {
|
|
6
6
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
|
+
description?: tailwind_merge.ClassNameValue;
|
|
7
8
|
input?: tailwind_merge.ClassNameValue;
|
|
8
9
|
label?: tailwind_merge.ClassNameValue;
|
|
9
|
-
description?: tailwind_merge.ClassNameValue;
|
|
10
10
|
field?: tailwind_merge.ClassNameValue;
|
|
11
11
|
error?: tailwind_merge.ClassNameValue;
|
|
12
12
|
};
|
|
@@ -14,9 +14,9 @@ declare const TextAreaStyles: tailwind_variants.TVReturnType<{
|
|
|
14
14
|
} | {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
17
|
+
description?: tailwind_merge.ClassNameValue;
|
|
17
18
|
input?: tailwind_merge.ClassNameValue;
|
|
18
19
|
label?: tailwind_merge.ClassNameValue;
|
|
19
|
-
description?: tailwind_merge.ClassNameValue;
|
|
20
20
|
field?: tailwind_merge.ClassNameValue;
|
|
21
21
|
error?: tailwind_merge.ClassNameValue;
|
|
22
22
|
};
|
|
@@ -30,9 +30,9 @@ declare const TextAreaStyles: tailwind_variants.TVReturnType<{
|
|
|
30
30
|
}, undefined, {
|
|
31
31
|
[key: string]: {
|
|
32
32
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
33
|
+
description?: tailwind_merge.ClassNameValue;
|
|
33
34
|
input?: tailwind_merge.ClassNameValue;
|
|
34
35
|
label?: tailwind_merge.ClassNameValue;
|
|
35
|
-
description?: tailwind_merge.ClassNameValue;
|
|
36
36
|
field?: tailwind_merge.ClassNameValue;
|
|
37
37
|
error?: tailwind_merge.ClassNameValue;
|
|
38
38
|
};
|
|
@@ -49,6 +49,6 @@ declare const TextAreaStyles: tailwind_variants.TVReturnType<{
|
|
|
49
49
|
input: string[];
|
|
50
50
|
description: string[];
|
|
51
51
|
error: string;
|
|
52
|
-
}, undefined, unknown, unknown
|
|
52
|
+
}, undefined, unknown, unknown>>;
|
|
53
53
|
|
|
54
54
|
export { TextAreaStyles };
|
|
@@ -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":"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","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"]}
|
|
@@ -4,9 +4,9 @@ import * as tailwind_merge from 'tailwind-merge';
|
|
|
4
4
|
declare const TextFieldStyles: tailwind_variants.TVReturnType<{
|
|
5
5
|
[key: string]: {
|
|
6
6
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
7
|
+
description?: tailwind_merge.ClassNameValue;
|
|
7
8
|
input?: tailwind_merge.ClassNameValue;
|
|
8
9
|
label?: tailwind_merge.ClassNameValue;
|
|
9
|
-
description?: tailwind_merge.ClassNameValue;
|
|
10
10
|
field?: tailwind_merge.ClassNameValue;
|
|
11
11
|
error?: tailwind_merge.ClassNameValue;
|
|
12
12
|
};
|
|
@@ -14,9 +14,9 @@ declare const TextFieldStyles: tailwind_variants.TVReturnType<{
|
|
|
14
14
|
} | {
|
|
15
15
|
[x: string]: {
|
|
16
16
|
[x: string]: tailwind_merge.ClassNameValue | {
|
|
17
|
+
description?: tailwind_merge.ClassNameValue;
|
|
17
18
|
input?: tailwind_merge.ClassNameValue;
|
|
18
19
|
label?: tailwind_merge.ClassNameValue;
|
|
19
|
-
description?: tailwind_merge.ClassNameValue;
|
|
20
20
|
field?: tailwind_merge.ClassNameValue;
|
|
21
21
|
error?: tailwind_merge.ClassNameValue;
|
|
22
22
|
};
|
|
@@ -30,9 +30,9 @@ declare const TextFieldStyles: tailwind_variants.TVReturnType<{
|
|
|
30
30
|
}, undefined, {
|
|
31
31
|
[key: string]: {
|
|
32
32
|
[key: string]: tailwind_merge.ClassNameValue | {
|
|
33
|
+
description?: tailwind_merge.ClassNameValue;
|
|
33
34
|
input?: tailwind_merge.ClassNameValue;
|
|
34
35
|
label?: tailwind_merge.ClassNameValue;
|
|
35
|
-
description?: tailwind_merge.ClassNameValue;
|
|
36
36
|
field?: tailwind_merge.ClassNameValue;
|
|
37
37
|
error?: tailwind_merge.ClassNameValue;
|
|
38
38
|
};
|
|
@@ -49,6 +49,6 @@ declare const TextFieldStyles: tailwind_variants.TVReturnType<{
|
|
|
49
49
|
input: string;
|
|
50
50
|
description: string[];
|
|
51
51
|
error: string;
|
|
52
|
-
}, undefined, unknown, unknown
|
|
52
|
+
}, undefined, unknown, unknown>>;
|
|
53
53
|
|
|
54
54
|
export { TextFieldStyles };
|
|
@@ -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
|