@accelint/design-system 0.8.1 → 0.9.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/aria/index.d.ts +32 -3
- package/dist/components/aria/index.js +36 -1
- package/dist/components/aria/index.js.map +1 -1
- package/dist/components/button/index.d.ts +45 -6
- package/dist/components/button/index.js +105 -3
- package/dist/components/button/index.js.map +1 -1
- package/dist/components/checkbox/index.d.ts +28 -7
- package/dist/components/checkbox/index.js +124 -3
- package/dist/components/checkbox/index.js.map +1 -1
- package/dist/components/chip/index.d.ts +36 -6
- package/dist/components/chip/index.js +171 -3
- package/dist/components/chip/index.js.map +1 -1
- package/dist/components/collection/index.d.ts +16 -5
- package/dist/components/collection/index.js +19 -1
- package/dist/components/collection/index.js.map +1 -1
- package/dist/components/combo-box/index.d.ts +13 -5
- package/dist/components/combo-box/index.js +116 -3
- package/dist/components/combo-box/index.js.map +1 -1
- package/dist/components/date-field/index.d.ts +13 -5
- package/dist/components/date-field/index.js +106 -2
- package/dist/components/date-field/index.js.map +1 -1
- package/dist/components/date-input/index.d.ts +19 -7
- package/dist/components/date-input/index.js +134 -2
- package/dist/components/date-input/index.js.map +1 -1
- package/dist/components/dialog/index.d.ts +24 -6
- package/dist/components/dialog/index.js +187 -3
- package/dist/components/dialog/index.js.map +1 -1
- package/dist/components/drawer/index.d.ts +19 -7
- package/dist/components/drawer/index.js +306 -3
- package/dist/components/drawer/index.js.map +1 -1
- package/dist/components/element/index.d.ts +15 -4
- package/dist/components/element/index.js +21 -2
- package/dist/components/element/index.js.map +1 -1
- package/dist/components/group/index.d.ts +15 -5
- package/dist/components/group/index.js +60 -3
- package/dist/components/group/index.js.map +1 -1
- package/dist/components/icon/index.d.ts +17 -5
- package/dist/components/icon/index.js +39 -3
- package/dist/components/icon/index.js.map +1 -1
- package/dist/components/index.d.ts +35 -35
- package/dist/components/index.js +58 -28
- package/dist/components/input/index.d.ts +12 -5
- package/dist/components/input/index.js +141 -3
- package/dist/components/input/index.js.map +1 -1
- package/dist/components/menu/index.d.ts +29 -5
- package/dist/components/menu/index.js +253 -3
- package/dist/components/menu/index.js.map +1 -1
- package/dist/components/merge-provider/index.d.ts +18 -3
- package/dist/components/merge-provider/index.js +43 -2
- package/dist/components/merge-provider/index.js.map +1 -1
- package/dist/components/number-field/index.d.ts +14 -6
- package/dist/components/number-field/index.js +127 -2
- package/dist/components/number-field/index.js.map +1 -1
- package/dist/components/number-field/number-field.css.d.ts +1 -1
- package/dist/components/number-field/types.d.ts +1 -1
- package/dist/components/options/index.d.ts +25 -5
- package/dist/components/options/index.js +254 -3
- package/dist/components/options/index.js.map +1 -1
- package/dist/components/picker/index.d.ts +23 -5
- package/dist/components/picker/index.js +113 -3
- package/dist/components/picker/index.js.map +1 -1
- package/dist/components/popover/index.d.ts +14 -6
- package/dist/components/popover/index.js +140 -3
- package/dist/components/popover/index.js.map +1 -1
- package/dist/components/query-builder/group.js +1 -1
- package/dist/components/query-builder/group.js.map +1 -1
- package/dist/components/query-builder/index.d.ts +7 -7
- package/dist/components/query-builder/index.js +198 -5
- package/dist/components/query-builder/index.js.map +1 -1
- package/dist/components/query-builder/rule.js +1 -1
- package/dist/components/query-builder/rule.js.map +1 -1
- package/dist/components/query-builder/value-editor.js.map +1 -1
- package/dist/components/query-builder/value-selector.js +1 -1
- package/dist/components/query-builder/value-selector.js.map +1 -1
- package/dist/components/radio/index.d.ts +22 -6
- package/dist/components/radio/index.js +114 -3
- package/dist/components/radio/index.js.map +1 -1
- package/dist/components/search-field/index.d.ts +15 -6
- package/dist/components/search-field/index.js +92 -3
- package/dist/components/search-field/index.js.map +1 -1
- package/dist/components/select/index.d.ts +13 -5
- package/dist/components/select/index.js +109 -3
- package/dist/components/select/index.js.map +1 -1
- package/dist/components/slider/index.d.ts +41 -7
- package/dist/components/slider/index.js +232 -3
- package/dist/components/slider/index.js.map +1 -1
- package/dist/components/slider/slider.css.d.ts +1 -1
- package/dist/components/slider/types.d.ts +1 -1
- package/dist/components/switch/index.d.ts +9 -5
- package/dist/components/switch/index.js +60 -3
- package/dist/components/switch/index.js.map +1 -1
- package/dist/components/tabs/index.d.ts +74 -7
- package/dist/components/tabs/index.js +259 -3
- package/dist/components/tabs/index.js.map +1 -1
- package/dist/components/text-field/index.d.ts +61 -6
- package/dist/components/text-field/index.js +93 -2
- package/dist/components/text-field/index.js.map +1 -1
- package/dist/components/textarea/index.d.ts +18 -5
- package/dist/components/textarea/index.js +134 -3
- package/dist/components/textarea/index.js.map +1 -1
- package/dist/components/time-field/index.d.ts +14 -6
- package/dist/components/time-field/index.js +103 -2
- package/dist/components/time-field/index.js.map +1 -1
- package/dist/components/tooltip/index.d.ts +29 -6
- package/dist/components/tooltip/index.js +112 -3
- package/dist/components/tooltip/index.js.map +1 -1
- package/dist/components/tree/index.d.ts +17 -5
- package/dist/components/tree/index.js +491 -3
- package/dist/components/tree/index.js.map +1 -1
- package/dist/components/tree/utils.js.map +1 -1
- package/dist/hooks/index.d.ts +12 -12
- package/dist/hooks/use-collection-render/index.d.ts +11 -3
- package/dist/hooks/use-collection-render/index.js +25 -1
- package/dist/hooks/use-collection-render/index.js.map +1 -1
- package/dist/hooks/use-context-props/index.d.ts +10 -3
- package/dist/hooks/use-context-props/index.js +15 -1
- package/dist/hooks/use-context-props/index.js.map +1 -1
- package/dist/hooks/use-defaults/index.d.ts +99 -31
- package/dist/hooks/use-defaults/index.js +33 -2
- package/dist/hooks/use-defaults/index.js.map +1 -1
- package/dist/hooks/use-defaults/types.d.ts +6 -6
- package/dist/hooks/use-propagating-press/index.d.ts +13 -2
- package/dist/hooks/use-propagating-press/index.js +19 -1
- package/dist/hooks/use-propagating-press/index.js.map +1 -1
- package/dist/hooks/use-slot/index.d.ts +16 -2
- package/dist/hooks/use-slot/index.js +18 -1
- package/dist/hooks/use-slot/index.js.map +1 -1
- package/dist/hooks/use-theme/index.d.ts +37 -8
- package/dist/hooks/use-theme/index.js +105 -2
- package/dist/hooks/use-theme/index.js.map +1 -1
- package/dist/hooks/use-theme/types.d.ts +2 -2
- package/dist/hooks/use-tree/index.d.ts +5 -2
- package/dist/hooks/use-tree/index.js +259 -1
- package/dist/hooks/use-tree/index.js.map +1 -1
- package/dist/hooks/use-tree/utils.js.map +1 -1
- package/dist/hooks/use-update-effect/index.d.ts +3 -1
- package/dist/hooks/use-update-effect/index.js +20 -1
- package/dist/hooks/use-update-effect/index.js.map +1 -1
- package/dist/index.css +119 -119
- package/dist/index.d.ts +47 -47
- package/dist/ladle/actions.js.map +1 -1
- package/dist/styles/layers.css.d.ts +3 -3
- package/dist/styles/surfaces.css.d.ts +1 -1
- package/dist/test/setup.js +78 -8
- package/dist/test/setup.js.map +1 -1
- package/dist/utils/{css.d.ts → css/index.d.ts} +2 -2
- package/dist/utils/{css.js → css/index.js} +5 -5
- package/dist/utils/css/index.js.map +1 -0
- package/dist/utils/events/index.js +10 -0
- package/dist/utils/events/index.js.map +1 -0
- package/dist/utils/index.d.ts +4 -4
- package/dist/utils/index.js +4 -4
- package/dist/utils/{props.d.ts → props/index.d.ts} +2 -2
- package/dist/utils/{props.js → props/index.js} +3 -3
- package/dist/utils/props/index.js.map +1 -0
- package/dist/utils/{validators.d.ts → validators/index.d.ts} +1 -1
- package/dist/utils/{validators.js → validators/index.js} +3 -3
- package/dist/utils/validators/index.js.map +1 -0
- package/dist/vanilla.d.ts +1 -1
- package/dist/vanilla.js +1 -1
- package/package.json +7 -8
- package/dist/components/aria/aria.d.ts +0 -32
- package/dist/components/aria/aria.js +0 -39
- package/dist/components/aria/aria.js.map +0 -1
- package/dist/components/button/button.d.ts +0 -47
- package/dist/components/button/button.js +0 -104
- package/dist/components/button/button.js.map +0 -1
- package/dist/components/checkbox/checkbox.d.ts +0 -30
- package/dist/components/checkbox/checkbox.js +0 -123
- package/dist/components/checkbox/checkbox.js.map +0 -1
- package/dist/components/chip/chip.d.ts +0 -41
- package/dist/components/chip/chip.js +0 -171
- package/dist/components/chip/chip.js.map +0 -1
- package/dist/components/collection/collection.d.ts +0 -17
- package/dist/components/collection/collection.js +0 -22
- package/dist/components/collection/collection.js.map +0 -1
- package/dist/components/combo-box/combo-box.d.ts +0 -21
- package/dist/components/combo-box/combo-box.js +0 -116
- package/dist/components/combo-box/combo-box.js.map +0 -1
- package/dist/components/date-field/date-field.d.ts +0 -20
- package/dist/components/date-field/date-field.js +0 -106
- package/dist/components/date-field/date-field.js.map +0 -1
- package/dist/components/date-input/date-input.d.ts +0 -42
- package/dist/components/date-input/date-input.js +0 -128
- package/dist/components/date-input/date-input.js.map +0 -1
- package/dist/components/dialog/dialog.d.ts +0 -29
- package/dist/components/dialog/dialog.js +0 -186
- package/dist/components/dialog/dialog.js.map +0 -1
- package/dist/components/drawer/drawer.d.ts +0 -28
- package/dist/components/drawer/drawer.js +0 -305
- package/dist/components/drawer/drawer.js.map +0 -1
- package/dist/components/element/element.d.ts +0 -16
- package/dist/components/element/element.js +0 -24
- package/dist/components/element/element.js.map +0 -1
- package/dist/components/group/group.d.ts +0 -16
- package/dist/components/group/group.js +0 -61
- package/dist/components/group/group.js.map +0 -1
- package/dist/components/icon/icon.d.ts +0 -17
- package/dist/components/icon/icon.js +0 -39
- package/dist/components/icon/icon.js.map +0 -1
- package/dist/components/input/input.d.ts +0 -13
- package/dist/components/input/input.js +0 -141
- package/dist/components/input/input.js.map +0 -1
- package/dist/components/menu/menu.d.ts +0 -32
- package/dist/components/menu/menu.js +0 -252
- package/dist/components/menu/menu.js.map +0 -1
- package/dist/components/merge-provider/merge-provider.d.ts +0 -20
- package/dist/components/merge-provider/merge-provider.js +0 -46
- package/dist/components/merge-provider/merge-provider.js.map +0 -1
- package/dist/components/number-field/number-field.d.ts +0 -20
- package/dist/components/number-field/number-field.js +0 -125
- package/dist/components/number-field/number-field.js.map +0 -1
- package/dist/components/options/options.d.ts +0 -28
- package/dist/components/options/options.js +0 -253
- package/dist/components/options/options.js.map +0 -1
- package/dist/components/picker/picker.d.ts +0 -24
- package/dist/components/picker/picker.js +0 -113
- package/dist/components/picker/picker.js.map +0 -1
- package/dist/components/popover/popover.d.ts +0 -22
- package/dist/components/popover/popover.js +0 -139
- package/dist/components/popover/popover.js.map +0 -1
- package/dist/components/query-builder/query-builder.d.ts +0 -23
- package/dist/components/query-builder/query-builder.js +0 -200
- package/dist/components/query-builder/query-builder.js.map +0 -1
- package/dist/components/radio/radio.d.ts +0 -23
- package/dist/components/radio/radio.js +0 -114
- package/dist/components/radio/radio.js.map +0 -1
- package/dist/components/search-field/search-field.d.ts +0 -21
- package/dist/components/search-field/search-field.js +0 -92
- package/dist/components/search-field/search-field.js.map +0 -1
- package/dist/components/select/select.d.ts +0 -20
- package/dist/components/select/select.js +0 -109
- package/dist/components/select/select.js.map +0 -1
- package/dist/components/slider/slider.d.ts +0 -49
- package/dist/components/slider/slider.js +0 -230
- package/dist/components/slider/slider.js.map +0 -1
- package/dist/components/switch/switch.d.ts +0 -10
- package/dist/components/switch/switch.js +0 -60
- package/dist/components/switch/switch.js.map +0 -1
- package/dist/components/tabs/tabs.d.ts +0 -75
- package/dist/components/tabs/tabs.js +0 -258
- package/dist/components/tabs/tabs.js.map +0 -1
- package/dist/components/text-field/text-field.d.ts +0 -64
- package/dist/components/text-field/text-field.js +0 -92
- package/dist/components/text-field/text-field.js.map +0 -1
- package/dist/components/textarea/textarea.d.ts +0 -19
- package/dist/components/textarea/textarea.js +0 -134
- package/dist/components/textarea/textarea.js.map +0 -1
- package/dist/components/time-field/time-field.d.ts +0 -21
- package/dist/components/time-field/time-field.js +0 -106
- package/dist/components/time-field/time-field.js.map +0 -1
- package/dist/components/tooltip/tooltip.d.ts +0 -30
- package/dist/components/tooltip/tooltip.js +0 -112
- package/dist/components/tooltip/tooltip.js.map +0 -1
- package/dist/components/tree/tree.d.ts +0 -29
- package/dist/components/tree/tree.js +0 -491
- package/dist/components/tree/tree.js.map +0 -1
- package/dist/hooks/use-collection-render/use-collection-render.d.ts +0 -11
- package/dist/hooks/use-collection-render/use-collection-render.js +0 -28
- package/dist/hooks/use-collection-render/use-collection-render.js.map +0 -1
- package/dist/hooks/use-context-props/use-context-props.d.ts +0 -10
- package/dist/hooks/use-context-props/use-context-props.js +0 -18
- package/dist/hooks/use-context-props/use-context-props.js.map +0 -1
- package/dist/hooks/use-defaults/use-defaults.d.ts +0 -110
- package/dist/hooks/use-defaults/use-defaults.js +0 -36
- package/dist/hooks/use-defaults/use-defaults.js.map +0 -1
- package/dist/hooks/use-propagating-press/use-propagating-press.d.ts +0 -13
- package/dist/hooks/use-propagating-press/use-propagating-press.js +0 -21
- package/dist/hooks/use-propagating-press/use-propagating-press.js.map +0 -1
- package/dist/hooks/use-slot/use-slot.d.ts +0 -16
- package/dist/hooks/use-slot/use-slot.js +0 -21
- package/dist/hooks/use-slot/use-slot.js.map +0 -1
- package/dist/hooks/use-theme/use-theme.d.ts +0 -77
- package/dist/hooks/use-theme/use-theme.js +0 -108
- package/dist/hooks/use-theme/use-theme.js.map +0 -1
- package/dist/hooks/use-tree/use-tree.d.ts +0 -7
- package/dist/hooks/use-tree/use-tree.js +0 -262
- package/dist/hooks/use-tree/use-tree.js.map +0 -1
- package/dist/hooks/use-update-effect/use-update-effect.d.ts +0 -3
- package/dist/hooks/use-update-effect/use-update-effect.js +0 -23
- package/dist/hooks/use-update-effect/use-update-effect.js.map +0 -1
- package/dist/utils/css.js.map +0 -1
- package/dist/utils/events.js +0 -10
- package/dist/utils/events.js.map +0 -1
- package/dist/utils/props.js.map +0 -1
- package/dist/utils/validators.js.map +0 -1
- /package/dist/utils/{events.d.ts → events/index.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StyleRule, GlobalStyleRule } from '@vanilla-extract/css';
|
|
2
|
-
import { RGBA } from '
|
|
3
|
-
import { Contract, MapLeafNodes, Primitive, CssVarFunction, PartialMapLeafNodes } from '
|
|
2
|
+
import { RGBA } from '../../types/deckgl.js';
|
|
3
|
+
import { Contract, MapLeafNodes, Primitive, CssVarFunction, PartialMapLeafNodes } from '../../types/vanilla-extract.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Parse out CSS var name from CSS var implementation
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
2
|
import { assignInlineVars } from '@vanilla-extract/dynamic';
|
|
3
3
|
import kebabCase from 'lodash/kebabCase';
|
|
4
|
-
import { layers } from '
|
|
5
|
-
import { pixelValueAsStringValidator, rgbaAsStringValidator } from '
|
|
4
|
+
import { layers } from '../../styles/layers.css.js';
|
|
5
|
+
import { pixelValueAsStringValidator, rgbaAsStringValidator } from '../validators/index.js';
|
|
6
6
|
|
|
7
7
|
function unwrapCssVar(cssVar) {
|
|
8
8
|
return cssVar.replace(/^var\((--[\w-]+)[^\w-]+.*/i, "$1");
|
|
@@ -161,5 +161,5 @@ function inlineVars(varsOrContract, values) {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar };
|
|
164
|
-
//# sourceMappingURL=
|
|
165
|
-
//# sourceMappingURL=
|
|
164
|
+
//# sourceMappingURL=index.js.map
|
|
165
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/css/index.ts"],"names":[],"mappings":";;;;;;AA4CO,SAAS,aAAa,MAAgB,EAAA;AAC3C,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,4BAAA,EAA8B,IAAI,CAAA;AAC1D;AAgBO,SAAS,eAAA,CACd,UACA,GACsB,EAAA;AACtB,EAAO,OAAA,MAAA,CAAO,OAAQ,CAAA,QAAQ,CAAE,CAAA,MAAA;AAAA,IAC9B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,gBAAgB,CAAM,KAAA;AAChC,MAAA,IAAI,oBAAoB,IAAM,EAAA;AAC5B,QAAA,GAAA,CAAI,G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ACjC;AAAA,KACD;AAAA,GACH;AACF;AAmBO,SAAS,eACd,QACA,EAAA,MAAA,EAGA,KAAQ,GAAA,MAAA,CAAO,UAAU,EACd,EAAA;AACX,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,IAAI,CAAI,GAAA,MAAA;AAEzB,EAAM,MAAA,iBAAA,GACJ,KAAM,CAAA,KAAA,GAAQ,MAAS,GAAA,IAAA;AAGzB,EAAO,OAAA;AAAA,IACL,QAAU,EAAA;AAAA,MACR,CAAC,KAAK,GAAG;AAAA,QACP,GAAI,MAAM,KAAQ,GAAA,KAAK,EAAE,IAAA,EAAM,MAAM,IAAK,EAAA;AAAA,QAC1C,GAAI,kBAAkB,MAClB,GAAA;AAAA,UACE,YAAc,EAAA,gBAAA,CAAoB,QAAU,EAAA,GAAG,iBAAiB;AAAA,YAElE;AAAC;AACP;AACF,GACF;AACF;AAcO,SAAS,UAAA,CACd,gBACA,MACwB,EAAA;AACxB,EAAO,OAAA,gBAAA;AAAA,IACL,MAAA,GACI,kBAAkB,cAAqB,EAAA,MAAM,IAC7C,MAAO,CAAA,OAAA,CAAQ,cAAc,CAAE,CAAA,MAAA;AAAA,MAC7B,CAAC,GAAA,EAAK,CAAC,GAAA,EAAK,KAAK,CAAM,KAAA;AACrB,QAAA,IAAI,SAAS,IAAM,EAAA;AACjB,UAAI,GAAA,CAAA,GAAG,CAAI,GAAA,CAAA,EAAG,KAAK,CAAA,CAAA;AAAA;AAGrB,QAAO,OAAA,GAAA;AAAA,OACT;AAAA,MACA;AAAC;AACH,GACN;AACF","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport type { GlobalStyleRule, StyleRule } from '@vanilla-extract/css';\nimport { assignInlineVars } from '@vanilla-extract/dynamic';\nimport kebabCase from 'lodash/kebabCase';\nimport { layers } from '../../styles/layers.css';\nimport type { RGBA } from '../../types/deckgl';\nimport type {\n Contract,\n CssVarFunction,\n MapLeafNodes,\n PartialMapLeafNodes,\n Primitive,\n} from '../../types/vanilla-extract';\nimport {\n pixelValueAsStringValidator,\n rgbaAsStringValidator,\n} from '../validators';\n\n/**\n * Parse out CSS var name from CSS var implementation\n *\n * @example\n * unwrapCssVar('var(--foo)')\n * // returns '--foo'\n *\n * @example\n * unwrapCssVar('var(--foo, blue)')\n * // returns '--foo'\n *\n * @example\n * unwrapCssVar('var(--foo, var(--bar))')\n * // returns '--foo'\n */\nexport function unwrapCssVar(cssVar: string) {\n return cssVar.replace(/^var\\((--[\\w-]+)[^\\w-]+.*/i, '$1');\n}\n\ntype FulfilledContract<T> = MapLeafNodes<T, null | number | string | RGBA>;\n\n// TODO: remove if possible\n// NOTE: had to create a generic version not bound to type of T because of type issues around setting values on accumulator\ntype GenericFulfilledContract = {\n [key: string]: GenericFulfilledContract | null | number | string | RGBA;\n};\n\n/**\n * Convert contract to nested object of identical shape with computed CSS values\n * Pixel values are converted to numbers\n * RGB(A) values are converted to DeckGL compatible tuples\n * All other values are left unconverted\n */\nexport function computeContract<T extends Contract>(\n contract: T,\n css: CSSStyleDeclaration,\n): FulfilledContract<T> {\n return Object.entries(contract).reduce<GenericFulfilledContract>(\n (acc, [key, cssVarOrContract]) => {\n if (cssVarOrContract == null) {\n acc[key] = null;\n\n return acc;\n }\n\n if (typeof cssVarOrContract === 'object') {\n acc[key] = computeContract(cssVarOrContract, css);\n\n return acc;\n }\n\n const cssVar = unwrapCssVar(cssVarOrContract);\n const value = css.getPropertyValue(cssVar);\n const pixel = pixelValueAsStringValidator.safeParse(value);\n\n if (pixel.success) {\n acc[key] = pixel.data;\n\n return acc;\n }\n\n const rgba = rgbaAsStringValidator.safeParse(value);\n\n if (rgba.success) {\n acc[key] = rgba.data;\n\n return acc;\n }\n\n acc[key] = value ?? null;\n\n return acc;\n },\n {},\n ) as FulfilledContract<T>;\n}\n\n/**\n * Convert potentially nested contract and values pair into flattened CSS var record\n * The contract provides a lookup for CSS vars\n * The values are expected to partially match the contract shapeForm\n */\nexport function reduceContract<T extends Contract, U>(\n contract: T,\n values: PartialMapLeafNodes<T, U>,\n) {\n const nodes: { contract: Contract; values: PartialMapLeafNodes<T, U> }[] = [\n { contract, values },\n ];\n\n const vars: Record<CssVarFunction, U> = {};\n\n for (const node of nodes) {\n // biome-ignore lint/complexity/noForEach: TODO: refactor. converting to for...of results in breaking complexity rule limit 🫠\n Object.entries(node.values).forEach(([key, value]: [string, U]) => {\n const cssVarOrSubContract = node.contract[key];\n\n if (cssVarOrSubContract == null || value == null) {\n return;\n }\n\n if (\n typeof cssVarOrSubContract === 'string' &&\n (typeof value !== 'object' || Array.isArray(value))\n ) {\n vars[cssVarOrSubContract] = value;\n\n return;\n }\n\n if (\n typeof cssVarOrSubContract === 'object' &&\n typeof value === 'object'\n ) {\n nodes.push({ contract: cssVarOrSubContract, values: value });\n }\n });\n }\n\n return vars;\n}\n\n/**\n * Reduce contract and values into Vanilla Extract friendly CSS vars\n */\nexport function assignPartialVars<T extends Contract>(\n contract: T,\n values: PartialMapLeafNodes<T, Primitive>,\n) {\n return Object.fromEntries(\n Object.entries(reduceContract(contract, values)).map(([key, value]) => [\n key,\n `${value}`,\n ]),\n );\n}\n\ntype CssVarValues = {\n [key: string]: CssVarValues | Primitive;\n};\n\ntype CssVarValueOptions<T extends object> = {\n [P in keyof T]?: T[P] extends object\n ? CssVarValueOptions<T[P]>\n : T[P] | T[P][];\n};\n\ntype Operators = 'and' | 'or';\n\ntype ContainerQueryOptions = {\n container?: string;\n operator?: Operators;\n maxHeight?: string;\n minHeight?: string;\n maxWidth?: string;\n minWidth?: string;\n};\n\ntype ContainerQueryValues<T extends CssVarValues> = CssVarValueOptions<T> &\n ContainerQueryOptions;\n\ntype MultiContainerQuery<T extends CssVarValues> = {\n operator?: Operators;\n groups: ContainerQueryValues<T>[];\n};\n\n/**\n * Handle creation of query groups based on options and values\n * Internal to containerQueries\n */\nfunction processConditions<T extends CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n values: ContainerQueryValues<T>,\n) {\n return Object.entries(\n reduceContract(\n {\n ...contract,\n maxHeight: 'maxHeight', // NOTE: Passthrough these values not as CSS vars\n minHeight: 'minHeight',\n maxWidth: 'maxWidth',\n minWidth: 'minWidth',\n },\n values as PartialMapLeafNodes<\n MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ContainerQueryValues<T>[string]\n >,\n ),\n ).reduce<string[]>((acc, [key, value]) => {\n if (key === 'container' || key === 'operator' || value == null) {\n return acc;\n }\n\n const isStyle = !/^(?:max|min)(?:Height|Width)$/.test(key);\n const prefix = isStyle ? 'style' : '';\n const prop = isStyle ? unwrapCssVar(key) : kebabCase(key);\n\n if (Array.isArray(value)) {\n const group = value.reduce<string[]>((ac, val) => {\n if (val != null) {\n ac.push(`${prefix}(${prop}: ${val})`);\n }\n\n return ac;\n }, []);\n\n acc.push(`(${group.join(' or ')})`);\n } else {\n acc.push(`${prefix}(${prop}: ${value})`);\n }\n\n return acc;\n }, []);\n}\n\nfunction isMultiQuery<T extends CssVarValues>(\n value: unknown,\n): value is MultiContainerQuery<T> {\n return (\n value != null &&\n typeof value === 'object' &&\n (!('operator' in value) ||\n ('operator' in value &&\n (value.operator === 'and' || value.operator === 'or'))) &&\n 'groups' in value &&\n Array.isArray(value.groups) &&\n value.groups.every((group) => group != null && typeof group === 'object')\n );\n}\n\n/**\n * Create simple or complex container queries with and/or operators.\n *\n * To provide type safety and ease of use, this function accepts a generic and a contract\n * The generic type defines the possible values for the parameters defined within the contract\n *\n * Ex: `containerQuery<{ foo: boolean }>({ foo: 'var(--foo)' }, { foo: true })`\n *\n * By providing the type constraint and contract, the query parameters will have intellisense\n * on which parameters exist and what their possible values can be\n *\n * @example\n * containerQuery(contract, { a: true })\n * // returns (a: true)\n *\n * @example\n * containerQuery(contract, { a: true, b: true })\n * // returns (a: true) and (b: true)\n *\n * @example\n * containerQuery(contract, { operator: 'or', a: true, b: true })\n * // returns (a: true) or (b: true)\n *\n * @example\n * containerQuery(contract, { groups: [{ a: true }, { b: true }] })\n * // returns (a: true) or (b: true)\n *\n * @example\n * containerQuery(contract, { a: ['foo', 'bar'] })\n * // returns (a: 'foo') or (a: 'bar')\n *\n * @example\n * containerQuery(contract, { a: ['foo', 'bar'], b: true })\n * // returns ((a: 'foo') or (a: 'bar')) and (b: true)\n *\n * @example\n * containerQuery(contract, { operator: 'or', a: ['foo', 'bar'], b: true })\n * // returns ((a: 'foo') or (a: 'bar')) or (b: true)\n *\n * @example\n * containerQuery(contract, { groups: [{ a: true, b: true }, { c: true, d: true }] })\n * // returns ((a: true) and (b: true)) or ((c: true) and (d: true))\n *\n * @example\n * containerQuery(contract, { operator: 'and', groups: [{ operator: 'or', a: true, b: true }, { c: true, d: true }] })\n * // returns ((a: true) or (b: true)) and ((c: true) and (d: true))\n *\n * @example\n * containerQuery(contract, { operator: 'and', groups: [{ operator: 'or', a: true, b: true }, { operator: 'or', c: true, d: true }] })\n * // returns ((a: true) or (b: true)) and ((c: true) or (d: true))\n */\nexport function containerQuery<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n query: ContainerQueryValues<T> | MultiContainerQuery<T>,\n) {\n const isMultiGroup = isMultiQuery<T>(query);\n const groups = isMultiGroup ? query.groups : [query];\n const groupsOperator = ` ${(isMultiGroup ? query.operator : null) ?? 'or'} `;\n\n return groups\n .map((group, index) => {\n const operator = ` ${group.operator ?? 'and'} `;\n\n let container = group.container ?? '';\n\n if (index) {\n // Multiple container specifiers is not yet supported: https://github.com/w3c/csswg-drafts/issues/6876\n container = '';\n }\n\n const conditions = processConditions(contract, group);\n const isMultiCondition = groups.length > 1 && conditions.length > 1;\n\n return [\n container,\n container && ' ',\n isMultiCondition ? '(' : '',\n conditions.join(operator),\n isMultiCondition ? ')' : '',\n ].join('');\n })\n .join(groupsOperator);\n}\n\ntype ContainerStyle = Exclude<StyleRule['@container'], undefined>[string];\n\ntype ContainerQuery<T extends CssVarValues> = {\n query: ContainerQueryValues<T> | MultiContainerQuery<T>;\n};\n\ntype ContainerQueries<T extends CssVarValues> = ContainerStyle &\n ContainerQuery<T>;\n\ntype GlobalContainerStyle = Exclude<\n GlobalStyleRule['@container'],\n undefined\n>[string];\n\ntype GlobalContainerQueries<T extends CssVarValues> = GlobalContainerStyle &\n ContainerQuery<T>;\n\n/**\n * Bulk container query creation based on the same contract\n */\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: ContainerQueries<T>[]\n): Record<string, ContainerStyle>;\n\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: GlobalContainerQueries<T>[]\n): Record<string, GlobalContainerStyle>;\n\nexport function containerQueries<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n ...styles: ContainerQueries<T>[] | GlobalContainerQueries<T>[]\n): Record<string, ContainerStyle | GlobalContainerStyle> {\n return Object.fromEntries(\n styles.map(({ query, ...style }) => [\n containerQuery<T>(contract, query),\n style,\n ]),\n );\n}\n\ntype VarsOnlyContainerQuery<T extends CssVarValues> = Required<\n Pick<ContainerQueries<T>, 'query' | 'vars'>\n>;\n\ntype QueryOptionalVarsOnlyContainerQuery<T extends CssVarValues> = Partial<\n Pick<VarsOnlyContainerQuery<T>, 'query'>\n> &\n Pick<VarsOnlyContainerQuery<T>, 'vars'>;\n\n/**\n * Helper for establishing global theme variables with the restriction that\n * only variables may be set (and are required). All other styles must be\n * established using alternative utils\n *\n * The first style rule has an optional query. If the query is missing, the vars\n * are set outside of a container query\n */\nexport function applyThemeVars<T extends CssVarValues = CssVarValues>(\n contract: MapLeafNodes<Omit<T, keyof ContainerQueryOptions>, CssVarFunction>,\n styles:\n | [QueryOptionalVarsOnlyContainerQuery<T>, ...VarsOnlyContainerQuery<T>[]]\n | VarsOnlyContainerQuery<T>[],\n layer = layers.variables.l1,\n): StyleRule {\n const [style, ...rest] = styles;\n\n const stylesWithQueries = (\n style.query ? styles : rest\n ) as VarsOnlyContainerQuery<T>[];\n\n return {\n '@layer': {\n [layer]: {\n ...(style.query ? {} : { vars: style.vars }),\n ...(stylesWithQueries.length\n ? {\n '@container': containerQueries<T>(contract, ...stylesWithQueries),\n }\n : {}),\n },\n },\n };\n}\n\n/**\n * Runtime creation of inline style CSS vars that enable CSS container queries\n */\nexport function inlineVars(\n vars: Record<string, Primitive>,\n): Record<string, string>;\n\nexport function inlineVars<T extends Contract>(\n contract: T,\n values: PartialMapLeafNodes<T, Primitive>,\n): Record<string, string>;\n\nexport function inlineVars<T extends Contract>(\n varsOrContract: Record<string, Primitive> | T,\n values?: PartialMapLeafNodes<T, Primitive>,\n): Record<string, string> {\n return assignInlineVars(\n values\n ? assignPartialVars(varsOrContract as T, values)\n : Object.entries(varsOrContract).reduce<Record<string, string>>(\n (acc, [key, value]) => {\n if (value != null) {\n acc[key] = `${value}`;\n }\n\n return acc;\n },\n {},\n ),\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/events/index.ts"],"names":[],"mappings":";;;AAsBO,SAAS,oBAAoB,KAAyB,EAAA;AAC3D,EAAA,KAAA,CAAM,mBAAoB,EAAA;AAC5B","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// Support React Aria's BaseEvent & PressEvent (and any others the might share the same interface)\ntype ContinuableEvent = {\n continuePropagation: () => void;\n};\n\n/**\n * The default behavior of events within React Aria is to stop progagation\n *\n * To reenable propagation, continuePropagation must be called\n */\nexport function continuePropagation(event: ContinuableEvent) {\n event.continuePropagation();\n}\n"]}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, unwrapCssVar } from './css.js';
|
|
2
|
-
export { continuePropagation } from './events.js';
|
|
3
|
-
export { callRenderProps, mergeClassNames, mergeProps, wrapRenderProps } from './props.js';
|
|
4
|
-
export { alphaChannelAsNumberValidator, alphaChannelAsStringValidator, colorChannelAsNumberValidator, colorChannelAsStringValidator, pixelValueAsNumberValidator, pixelValueAsStringValidator, rgbaAsStringValidator, rgbaAsTupleValidator } from './validators.js';
|
|
1
|
+
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, unwrapCssVar } from './css/index.js';
|
|
2
|
+
export { continuePropagation } from './events/index.js';
|
|
3
|
+
export { callRenderProps, mergeClassNames, mergeProps, wrapRenderProps } from './props/index.js';
|
|
4
|
+
export { alphaChannelAsNumberValidator, alphaChannelAsStringValidator, colorChannelAsNumberValidator, colorChannelAsStringValidator, pixelValueAsNumberValidator, pixelValueAsStringValidator, rgbaAsStringValidator, rgbaAsTupleValidator } from './validators/index.js';
|
|
5
5
|
import '@vanilla-extract/css';
|
|
6
6
|
import '../types/deckgl.js';
|
|
7
7
|
import '../types/vanilla-extract.js';
|
package/dist/utils/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../chunk-PZ5AY32C.js';
|
|
2
|
-
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, unwrapCssVar } from './css.js';
|
|
3
|
-
export { continuePropagation } from './events.js';
|
|
4
|
-
export { callRenderProps, mergeClassNames, mergeProps, wrapRenderProps } from './props.js';
|
|
5
|
-
export { alphaChannelAsNumberValidator, alphaChannelAsStringValidator, colorChannelAsNumberValidator, colorChannelAsStringValidator, pixelValueAsNumberValidator, pixelValueAsStringValidator, rgbaAsStringValidator, rgbaAsTupleValidator } from './validators.js';
|
|
2
|
+
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, unwrapCssVar } from './css/index.js';
|
|
3
|
+
export { continuePropagation } from './events/index.js';
|
|
4
|
+
export { callRenderProps, mergeClassNames, mergeProps, wrapRenderProps } from './props/index.js';
|
|
5
|
+
export { alphaChannelAsNumberValidator, alphaChannelAsStringValidator, colorChannelAsNumberValidator, colorChannelAsStringValidator, pixelValueAsNumberValidator, pixelValueAsStringValidator, rgbaAsStringValidator, rgbaAsTupleValidator } from './validators/index.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AsType } from '
|
|
2
|
-
import { ClassNames } from '
|
|
1
|
+
import { AsType } from '../../types/generic.js';
|
|
2
|
+
import { ClassNames } from '../../types/props.js';
|
|
3
3
|
|
|
4
4
|
type Props<T extends object> = AsType<T> | null | undefined;
|
|
5
5
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
2
|
import { mergeProps as mergeProps$1 } from '@react-aria/utils';
|
|
3
3
|
import { clsx } from 'clsx';
|
|
4
4
|
import mergeWith from 'lodash/mergeWith';
|
|
@@ -140,5 +140,5 @@ function wrapRenderProps(value, inject) {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
export { callRenderProps, mergeClassNames, mergeProps, wrapRenderProps };
|
|
143
|
-
//# sourceMappingURL=
|
|
144
|
-
//# sourceMappingURL=
|
|
143
|
+
//# sourceMappingURL=index.js.map
|
|
144
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/props/index.ts"],"names":["mergePropsWithoutStyles"],"mappings":";;;;;;;AA+BA,SAAS,2BAAA,CACP,KACA,EAAA,WAAA,EAAA,GACG,YACK,EAAA;AACR,EAAI,IAAA,CAAC,aAAa,MAAQ,EAAA;AACxB,IAAO,OAAA,EAAA;AAAA;AAGT,EAAA,MAAM,CAAC,KAAA,EAAO,GAAG,IAAI,CAAI,GAAA,YAAA;AAEzB,EAAO,OAAA,IAAA;AAAA,IACL,KAAA;AAAA,IACA,kBAAA;AAAA,MACE,OAAO,SAAa,IAAA,EAAA;AAAA,MACpB,CAAC,IAAS,KAAA,2BAAA,CAA4B,IAAM,EAAA,WAAA,EAAa,GAAG,IAAI;AAAA,MAChE,WAAW;AAAA,GACf;AACF;AAKA,SAAS,wBACJ,YACH,EAAA;AACA,EAAO,OAAA,kBAAA;AAAA,IACL,CAAC,WAAgB,KAAA,WAAA,CAAY,gBAAoB,IAAA,EAAA;AAAA,IACjD,CAAC,IAAM,EAAA,WAAA,KACL,4BAA4B,IAAM,EAAA,WAAA,EAAa,GAAG,YAAY;AAAA,GAClE;AACF;AAKA,SAAS,wBACJ,YACH,EAAA;AACA,EAAO,OAAA,IAAA;AAAA,IACL,YAAa,CAAA,MAAA,CAAiB,CAAC,GAAA,EAAK,KAAU,KAAA;AAC5C,MAAI,IAAA,OAAO,KAAO,EAAA,SAAA,KAAc,QAAU,EAAA;AACxC,QAAO,OAAA,GAAA;AAAA;AAGT,MAAI,GAAA,CAAA,IAAA,CAAK,MAAM,SAAS,CAAA;AAExB,MAAO,OAAA,GA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AAAA,MACH,GAAG;AAAA,KACK,CAAA;AAAA;AAGd,EAAO,OAAA,KAAA;AACT","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 { mergeProps as mergePropsWithoutStyles } from '@react-aria/utils';\nimport { clsx } from 'clsx';\nimport mergeWith from 'lodash/mergeWith';\nimport type { CSSProperties } from 'react';\nimport { composeRenderProps } from 'react-aria-components';\nimport { z } from 'zod';\nimport type { AsType } from '../../types/generic';\nimport type { ClassNames } from '../../types/props';\nimport type {\n ClassNameRenderProps,\n RenderProps,\n StylePropRenderProps,\n} from '../../types/react-aria';\n\ntype Props<T extends object> = AsType<T> | null | undefined;\n\n/**\n * Recursively process merging of all class name render props\n */\nfunction processClassNameRenderProps<T extends RenderProps<object>>(\n value: string,\n renderProps: ClassNameRenderProps<object>,\n ...propsToMerge: Props<T>[]\n): string {\n if (!propsToMerge.length) {\n return '';\n }\n\n const [props, ...rest] = propsToMerge;\n\n return clsx(\n value,\n composeRenderProps<string, ClassNameRenderProps<object>, string>(\n props?.className ?? '',\n (prev) => processClassNameRenderProps(prev, renderProps, ...rest),\n )(renderProps),\n );\n}\n\n/**\n * Compose class name render props to be processed and merged\n */\nfunction mergeRenderClassName<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return composeRenderProps<string, ClassNameRenderProps<object>, string>(\n (renderProps) => renderProps.defaultClassName ?? '',\n (prev, renderProps) =>\n processClassNameRenderProps(prev, renderProps, ...propsToMerge),\n );\n}\n\n/**\n * Merge static class names\n */\nfunction mergeStaticClassName<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return clsx(\n propsToMerge.reduce<string[]>((acc, props) => {\n if (typeof props?.className !== 'string') {\n return acc;\n }\n\n acc.push(props.className);\n\n return acc;\n }, []),\n );\n}\n\n/**\n * Determine if a static or composed merge of class names is necesary based on the presence of functions\n */\nfunction mergeClassNameProps<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n const anyFunctions = propsToMerge.some(\n (props) => typeof props?.className === 'function',\n );\n\n const anyPrimitives = propsToMerge.some(\n (props) => typeof props?.className === 'string',\n );\n\n if (!(anyFunctions || anyPrimitives)) {\n return undefined;\n }\n\n return anyFunctions\n ? mergeRenderClassName(...propsToMerge)\n : mergeStaticClassName(...propsToMerge);\n}\n\nconst classNamesValidator: z.ZodType<ClassNames> = z.record(\n z.string(),\n z.union([z.string(), z.lazy(() => classNamesValidator)]),\n);\n\nconst propsValidator = z.object({\n classNames: classNamesValidator,\n});\n\n/**\n * Deep merges classNames objects within props\n */\nfunction mergeClassNamesProps<T extends object>(...propsToMerge: Props<T>[]) {\n return propsToMerge.reduce<ClassNames | undefined>((acc, props) => {\n const result = propsValidator.safeParse(props);\n\n if (result.success) {\n return acc\n ? mergeWith(acc, result.data.classNames, (accValue, srcValue) =>\n (!accValue || typeof accValue === 'string') &&\n (!srcValue || typeof srcValue === 'string')\n ? clsx(accValue, srcValue)\n : undefined,\n )\n : result.data.classNames;\n }\n\n return acc;\n }, undefined);\n}\n\n/**\n * Deep merges classNames objects by concatenating class values\n *\n * @example\n * mergeClassNames({ foo: 'foo' }, { foo: 'FOO', bar: 'bar' })\n * // returns { foo: 'foo FOO', bar: 'bar' }\n */\nexport function mergeClassNames<T extends ClassNames>(\n ...classNamesToMerge: (T | null | undefined)[]\n) {\n return mergeClassNamesProps(\n ...classNamesToMerge.map((classNames) => ({ classNames })),\n ) as T | undefined;\n}\n\n/**\n * Recursively process merging of all style render props\n */\nfunction processStyleRenderProps<T extends RenderProps<object>>(\n value: CSSProperties,\n renderProps: StylePropRenderProps<object>,\n ...propsToMerge: Props<T>[]\n): CSSProperties {\n if (!propsToMerge.length) {\n return {};\n }\n\n const [props, ...rest] = propsToMerge;\n\n return {\n ...value,\n ...composeRenderProps<\n CSSProperties,\n StylePropRenderProps<object>,\n CSSProperties\n >(props?.style ?? {}, (prev) =>\n processStyleRenderProps(prev, renderProps, ...rest),\n )(renderProps),\n };\n}\n\n/**\n * Compose style render props to be processed and merged\n */\nfunction mergeRenderStyle<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return composeRenderProps<\n CSSProperties,\n StylePropRenderProps<object>,\n CSSProperties\n >(\n (renderProps) => renderProps.defaultStyle ?? {},\n (prev, renderProps) =>\n processStyleRenderProps(prev, renderProps, ...propsToMerge),\n );\n}\n\n/**\n * Merge static styles\n */\nfunction mergeStaticStyle<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n return propsToMerge.reduce<CSSProperties>((acc, props) => {\n if (!props?.style) {\n return acc;\n }\n\n Object.assign(acc, props.style);\n\n return acc;\n }, {});\n}\n\n/**\n * Determine if a static or composed merge of styles is necesary based on the presence of functions\n */\nfunction mergeStyleProps<T extends RenderProps<object>>(\n ...propsToMerge: Props<T>[]\n) {\n const anyFunctions = propsToMerge.some(\n (props) => typeof props?.style === 'function',\n );\n\n const anyObjects = propsToMerge.some(\n (props) => typeof props?.style === 'object' && props.style != null,\n );\n\n if (!(anyFunctions || anyObjects)) {\n return undefined;\n }\n\n return anyFunctions\n ? mergeRenderStyle(...propsToMerge)\n : mergeStaticStyle(...propsToMerge);\n}\n\n/**\n * Extends the base margeProps functionality to also merge styles and handle class/style render props\n */\nexport function mergeProps<T extends object>(...propsToMerge: Props<T>[]): T {\n const className = mergeClassNameProps(...propsToMerge);\n const classNames = mergeClassNamesProps(...propsToMerge);\n const style = mergeStyleProps(...propsToMerge);\n\n return {\n ...(mergePropsWithoutStyles(...propsToMerge) as T),\n ...(className ? { className } : {}),\n ...(classNames ? { classNames } : {}),\n ...(style ? { style } : {}),\n };\n}\n\n/**\n * A helper for not having to reimplement the type check for a renderProp value being a function or not everywhere\n */\nexport function callRenderProps<T extends object, R>(\n value: R | ((renderProps: T) => R),\n values: T,\n) {\n if (typeof value === 'function') {\n return (value as (renderProps: T) => R)(values);\n }\n\n return value;\n}\n\n/**\n * A helper function to pair with React Aria's render props. Typically\n * implemented with children, className and styles\n *\n * Allows for the injection of additional renderProps that a component\n * from React Aria may not already provide\n *\n * If the value isn't a renderProp function, then it is passed through unchanged\n */\nexport function wrapRenderProps<T extends object, U extends object, R>(\n value: R | ((renderProps: T & U) => R),\n inject?: U,\n) {\n if (typeof value === 'function') {\n return (renderProps: T) =>\n (value as (renderProps: T & U) => R)({\n ...renderProps,\n ...inject,\n } as T & U);\n }\n\n return value;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import '../../chunk-PZ5AY32C.js';
|
|
2
2
|
import clamp from 'lodash/clamp';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
@@ -38,5 +38,5 @@ var rgbaAsTupleValidator = z.union([
|
|
|
38
38
|
]);
|
|
39
39
|
|
|
40
40
|
export { alphaChannelAsNumberValidator, alphaChannelAsStringValidator, colorChannelAsNumberValidator, colorChannelAsStringValidator, pixelValueAsNumberValidator, pixelValueAsStringValidator, rgbaAsStringValidator, rgbaAsTupleValidator };
|
|
41
|
-
//# sourceMappingURL=
|
|
42
|
-
//# sourceMappingURL=
|
|
41
|
+
//# sourceMappingURL=index.js.map
|
|
42
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/validators/index.ts"],"names":[],"mappings":";;;;AAmBO,IAAM,2BAA8B,GAAA,CAAA,CAAE,MAAO,EAAA,CAAE,IAAK;AAW9C,IAAA,2BAAA,GAA8B,EACxC,KAAM,CAAA;AAAA,EACL,CAAA,CAAE,Q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CAAA,KAAA,EAAO,EAAE,CAAC;AAClD,CAAC,CACA,CAAA,SAAA,CAAU,CAAC,KAAA,KAAU,KAAM,CAAA,OAAA,CAAQ,UAAY,EAAA,EAAE,CAAE,CAAA,KAAA,CAAM,GAAG,CAAC,CAC7D,CAAA,IAAA;AAAA,EACC,EAAE,KAAM,CAAA;AAAA,IACN,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD;AACH;AAOW,IAAA,oBAAA,GAAuB,EAAE,KAAM,CAAA;AAAA,EAC1C,EACG,KAAM,CAAA;AAAA,IACL,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD,EACA,SAAgB,CAAA,CAAC,QAAQ,CAAC,GAAG,GAAK,EAAA,GAAG,CAAC,CAAA;AAAA,EACzC,EAAE,KAAM,CAAA;AAAA,IACN,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA,6BAAA;AAAA,IACA;AAAA,GACD;AACH,CAAC","file":"index.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport clamp from 'lodash/clamp';\nimport { z } from 'zod';\nimport type { RGBA } from '../../types/deckgl';\n\n/**\n * Test for any safe number that could represent a pixel value\n */\nexport const pixelValueAsNumberValidator = z.number().safe();\n\n/**\n * Test for and capture numeric pixel values\n * Will allow decimals and negative numbers\n *\n * Examples:\n * 0 -> 0\n * 1px -> 1\n * 20.5px -> 20.5\n */\nexport const pixelValueAsStringValidator = z\n .union([\n z.literal('0'),\n z\n .string()\n .endsWith('px')\n .transform((value) => value.replace(/px$/, '')),\n ])\n .pipe(z.coerce.number())\n .pipe(pixelValueAsNumberValidator);\n\n/**\n * Test for an integer in the range of 0-255 as a representation of an RGB color channel value\n */\nexport const colorChannelAsNumberValidator = z\n .number()\n .safe()\n .int()\n .min(0)\n .max(255);\n\n/**\n * Test for and convert CSS RGB color channel to numeric value (0-255)\n */\nexport const colorChannelAsStringValidator = z\n .string()\n .trim()\n .pipe(z.coerce.number())\n .pipe(colorChannelAsNumberValidator);\n\n/**\n * DeckGL treats alpha channel the same as color channels (0-255)\n */\nexport const alphaChannelAsNumberValidator = colorChannelAsNumberValidator;\n\n/**\n * Test for and convert CSS RGBA alpha channel to DeckGL numeric value\n */\nexport const alphaChannelAsStringValidator = z\n .string()\n .trim()\n .pipe(z.coerce.number().safe().min(0)) // CSS allows for values greater than 1\n .transform((value) => Math.round(clamp(value, 0, 1) * 255));\n\n/**\n * Test for and convert CSS RGB(A) values to numeric RGBA tuple\n * Will only allow for rgb with 3 valid numbers `(0-255){3, intergers only}`\n * Will only allow for rgba with 4 valid numbers `(0-255){3, intergers only} + (0-1){1, decimals allowed}`\n * Will allow for whitespace spread throughout\n *\n * Examples:\n * rgb( 0, 0, 0 ) -> [0, 0, 0, 255]\n * rgba(203,117,98,0.4) -> [203, 117, 98, 102]\n */\nexport const rgbaAsStringValidator = z\n .union([\n z\n .string()\n .startsWith('rgb(')\n .endsWith(')')\n .transform((value) => value.replace(/\\)$/, ',1')), // Add on 100% alpha channel\n z\n .string()\n .startsWith('rgba(')\n .endsWith(')')\n .transform((value) => value.replace(/\\)$/, '')),\n ])\n .transform((value) => value.replace(/^rgba?\\(/, '').split(','))\n .pipe(\n z.tuple([\n colorChannelAsStringValidator,\n colorChannelAsStringValidator,\n colorChannelAsStringValidator,\n alphaChannelAsStringValidator,\n ]),\n );\n\n/**\n * Test for numeric RGB(A) tuple\n *\n * Will return RGB as RGBA with 100% alpha channel\n */\nexport const rgbaAsTupleValidator = z.union([\n z\n .tuple([\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n ])\n .transform<RGBA>((rgb) => [...rgb, 255]),\n z.tuple([\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n colorChannelAsNumberValidator,\n alphaChannelAsNumberValidator,\n ]),\n]);\n"]}
|
package/dist/vanilla.d.ts
CHANGED
|
@@ -60,7 +60,7 @@ export { ClassNames, OmitProtectedProps } from './types/props.js';
|
|
|
60
60
|
export { ChildrenRenderProps, ClassNameRenderProps, ProviderValue, ProviderValues, RenderProps, RenderPropsChildren, RenderPropsClassName, RenderPropsStyle, StylePropRenderProps, StyleRenderProps } from './types/react-aria.js';
|
|
61
61
|
export { TreeActions, TreeGroupNode, TreeItemNode, TreeNode, TreeNodes, UseTreeOptions, UseTreeResult } from './types/use-tree.js';
|
|
62
62
|
export { Contract, CssVarFunction, MapLeafNodes, PartialMapLeafNodes, Primitive } from './types/vanilla-extract.js';
|
|
63
|
-
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar } from './utils/css.js';
|
|
63
|
+
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar } from './utils/css/index.js';
|
|
64
64
|
import 'react-aria-components';
|
|
65
65
|
import '@react-types/shared';
|
|
66
66
|
import 'type-fest';
|
package/dist/vanilla.js
CHANGED
|
@@ -25,6 +25,6 @@ export { textFieldClassNames, textFieldColorVars, textFieldContainer, textFieldS
|
|
|
25
25
|
export { tooltipClassNames, tooltipContainers, tooltipSpaceVars, tooltipStateVars, tooltipTargetStateVars } from './components/tooltip/tooltip.css.js';
|
|
26
26
|
export { treeClassNames, treeColorVars, treeContainers, treeGroupStateVars, treeIndicatorStateVars, treeItemStateVars, treeSpaceVars, treeStateVars } from './components/tree/tree.css.js';
|
|
27
27
|
export { bodies, defaultElevationVarValues, defaultElevations, defaultFocus, defaultFocusVarValues, defaultGenericColorVarValues, defaultGenericColors, defaultRadius, defaultRadiusVarValues, defaultSemanticColorVarValues, defaultSemanticColors, defaultSizes, defaultSizesVarValues, defaultSpace, defaultSpaceVarValues, defaultTypography, defaultTypographyVarValues, defaultZIndex, defaultZIndexVarValues, elevationVars, families, focusOutlineStyle, focusVars, genericColorVars, headings, inputs, label, layers, radiusVars, semanticColorVars, sizeVars, spaceVars, surfaces, typographyVars, zIndexVars } from './styles/index.js';
|
|
28
|
-
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar } from './utils/css.js';
|
|
28
|
+
export { applyThemeVars, assignPartialVars, computeContract, containerQueries, containerQuery, inlineVars, reduceContract, unwrapCssVar } from './utils/css/index.js';
|
|
29
29
|
//# sourceMappingURL=vanilla.js.map
|
|
30
30
|
//# sourceMappingURL=vanilla.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@accelint/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"@internationalized/date": "3.
|
|
38
|
+
"@internationalized/date": "3.8.0",
|
|
39
39
|
"@react-aria/collections": "3.0.0-alpha.5",
|
|
40
40
|
"@react-aria/datepicker": "3.14.1",
|
|
41
41
|
"@react-aria/dnd": "3.7.4",
|
|
42
42
|
"@react-aria/focus": "3.18.4",
|
|
43
43
|
"@react-aria/i18n": "3.12.4",
|
|
44
44
|
"@react-aria/interactions": "3.22.4",
|
|
45
|
-
"@react-aria/overlays": "3.
|
|
45
|
+
"@react-aria/overlays": "3.27.1",
|
|
46
46
|
"@react-aria/ssr": "3.9.6",
|
|
47
47
|
"@react-aria/utils": "3.25.3",
|
|
48
48
|
"@react-stately/data": "3.11.7",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"@fontsource/roboto-mono": "5.1.0",
|
|
61
61
|
"@ladle/react": "4.1.2",
|
|
62
62
|
"@testing-library/dom": "10.4.0",
|
|
63
|
-
"@testing-library/jest-dom": "6.
|
|
64
|
-
"@testing-library/react": "16.0
|
|
65
|
-
"@testing-library/user-event": "14.
|
|
63
|
+
"@testing-library/jest-dom": "6.6.3",
|
|
64
|
+
"@testing-library/react": "16.3.0",
|
|
65
|
+
"@testing-library/user-event": "14.6.1",
|
|
66
66
|
"@types/lodash": "4.17.10",
|
|
67
67
|
"@types/react": "18.3.11",
|
|
68
68
|
"@types/react-dom": "18.3.1",
|
|
@@ -73,8 +73,7 @@
|
|
|
73
73
|
"esbuild-plugin-lodash": "1.2.0",
|
|
74
74
|
"jsdom": "25.0.1",
|
|
75
75
|
"postcss": "8.4.47",
|
|
76
|
-
"
|
|
77
|
-
"tsup": "8.3.0",
|
|
76
|
+
"tsup": "8.4.0",
|
|
78
77
|
"vite": "5.4.9",
|
|
79
78
|
"vitest": "2.1.3",
|
|
80
79
|
"@accelint/biome-config": "0.1.2",
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { RefAttributes } from 'react';
|
|
3
|
-
import * as react_aria_components from 'react-aria-components';
|
|
4
|
-
import { ContextValue, SectionProps, SelectValueProps } from 'react-aria-components';
|
|
5
|
-
|
|
6
|
-
declare const AriaFieldError: (props: react_aria_components.FieldErrorProps & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
7
|
-
declare const AriaFieldErrorContext: react.Context<ContextValue<react_aria_components.FieldErrorProps & RefAttributes<HTMLElement>, HTMLElement>>;
|
|
8
|
-
declare const AriaGroup: (props: react_aria_components.GroupProps & RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
|
9
|
-
declare const AriaGroupContext: react.Context<ContextValue<react_aria_components.GroupProps & RefAttributes<HTMLDivElement>, HTMLDivElement>>;
|
|
10
|
-
declare const AriaHeader: (props: react.HTMLAttributes<HTMLElement> & RefAttributes<object> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
11
|
-
declare const AriaHeaderContext: react.Context<ContextValue<react.HTMLAttributes<HTMLElement> & RefAttributes<object>, HTMLElement>>;
|
|
12
|
-
declare const AriaHeading: (props: react_aria_components.HeadingProps & RefAttributes<HTMLHeadingElement>) => react.ReactElement | null;
|
|
13
|
-
declare const AriaHeadingContext: react.Context<ContextValue<react_aria_components.HeadingProps & RefAttributes<HTMLHeadingElement>, HTMLHeadingElement>>;
|
|
14
|
-
declare const AriaKeyboard: (props: react.HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
15
|
-
declare const AriaKeyboardContext: react.Context<ContextValue<react.HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>, HTMLElement>>;
|
|
16
|
-
declare const AriaLabel: (props: react_aria_components.LabelProps & RefAttributes<HTMLLabelElement>) => react.ReactElement | null;
|
|
17
|
-
declare const AriaLabelContext: react.Context<ContextValue<react_aria_components.LabelProps & RefAttributes<HTMLLabelElement>, HTMLLabelElement>>;
|
|
18
|
-
declare const AriaSeparator: (props: react_aria_components.SeparatorProps & RefAttributes<object> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
19
|
-
declare const AriaSeparatorContext: react.Context<ContextValue<react_aria_components.SeparatorProps & RefAttributes<object>, HTMLElement>>;
|
|
20
|
-
declare const AriaText: (props: react_aria_components.TextProps & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
21
|
-
declare const AriaTextContext: react.Context<ContextValue<react_aria_components.TextProps & RefAttributes<HTMLElement>, HTMLElement>>;
|
|
22
|
-
/**
|
|
23
|
-
* Due to the complexity of types and technical constraints of TS, it's not
|
|
24
|
-
* possible for the above wrapping utility to support components that accept
|
|
25
|
-
* generic parameters. This means that these components must be manually wrapped
|
|
26
|
-
*/
|
|
27
|
-
declare const AriaSectionContext: react.Context<ContextValue<SectionProps<object>, HTMLElement>>;
|
|
28
|
-
declare const AriaSection: <T extends object>(props: SectionProps<T> & RefAttributes<HTMLElement>) => react.ReactElement | null;
|
|
29
|
-
declare const AriaSelectValueContext: react.Context<ContextValue<SelectValueProps<object>, HTMLSpanElement>>;
|
|
30
|
-
declare const AriaSelectValue: <T extends object>(props: SelectValueProps<T> & RefAttributes<HTMLSpanElement>) => react.ReactElement | null;
|
|
31
|
-
|
|
32
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext };
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import '../../chunk-PZ5AY32C.js';
|
|
2
|
-
import { createContext, forwardRef } from 'react';
|
|
3
|
-
import { Section, SelectValue, FieldError, Group, Header, Heading, Keyboard, Label, Separator, Text } from 'react-aria-components';
|
|
4
|
-
import { useContextProps } from '../../hooks/index.js';
|
|
5
|
-
import { jsx } from 'react/jsx-runtime';
|
|
6
|
-
|
|
7
|
-
function wrap(Component) {
|
|
8
|
-
const Context = createContext(null);
|
|
9
|
-
return {
|
|
10
|
-
// biome-ignore lint/style/useNamingConvention: intentional
|
|
11
|
-
Component: forwardRef(function WrappedComponent(props, ref) {
|
|
12
|
-
[props, ref] = useContextProps(props, ref, Context);
|
|
13
|
-
return /* @__PURE__ */ jsx(Component, { ...props, ref });
|
|
14
|
-
}),
|
|
15
|
-
Context
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
var { Component: AriaFieldError, Context: AriaFieldErrorContext } = wrap(FieldError);
|
|
19
|
-
var { Component: AriaGroup, Context: AriaGroupContext } = wrap(Group);
|
|
20
|
-
var { Component: AriaHeader, Context: AriaHeaderContext } = wrap(Header);
|
|
21
|
-
var { Component: AriaHeading, Context: AriaHeadingContext } = wrap(Heading);
|
|
22
|
-
var { Component: AriaKeyboard, Context: AriaKeyboardContext } = wrap(Keyboard);
|
|
23
|
-
var { Component: AriaLabel, Context: AriaLabelContext } = wrap(Label);
|
|
24
|
-
var { Component: AriaSeparator, Context: AriaSeparatorContext } = wrap(Separator);
|
|
25
|
-
var { Component: AriaText, Context: AriaTextContext } = wrap(Text);
|
|
26
|
-
var AriaSectionContext = createContext(null);
|
|
27
|
-
var AriaSection = forwardRef(function AriaSection2(props, ref) {
|
|
28
|
-
[props, ref] = useContextProps(props, ref, AriaSectionContext);
|
|
29
|
-
return /* @__PURE__ */ jsx(Section, { ...props, ref });
|
|
30
|
-
});
|
|
31
|
-
var AriaSelectValueContext = createContext(null);
|
|
32
|
-
var AriaSelectValue = forwardRef(function AriaSelectValue2(props, ref) {
|
|
33
|
-
[props, ref] = useContextProps(props, ref, AriaSelectValueContext);
|
|
34
|
-
return /* @__PURE__ */ jsx(SelectValue, { ...props, ref });
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export { AriaFieldError, AriaFieldErrorContext, AriaGroup, AriaGroupContext, AriaHeader, AriaHeaderContext, AriaHeading, AriaHeadingContext, AriaKeyboard, AriaKeyboardContext, AriaLabel, AriaLabelContext, AriaSection, AriaSectionContext, AriaSelectValue, AriaSelectValueContext, AriaSeparator, AriaSeparatorContext, AriaText, AriaTextContext };
|
|
38
|
-
//# sourceMappingURL=aria.js.map
|
|
39
|
-
//# sourceMappingURL=aria.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/aria/aria.tsx"],"names":["AriaSection","AriaSelectValue"],"mappings":";;;;;;AA0CA,SAAS,KACP,SACA,EAAA;AACA,EAAM,MAAA,OAAA,GAAU,cAAkC,IAAI,CAAA;AAEtD,EAAO,OAAA;AAAA;AAAA,IAEL,SAAW,EAAA,UAAA,CAAiB,SAAS,gBAAA,CAAiB,OAAO,GAAK,EAAA;AAChE,MAAA,CAAC,OAA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CAEjD,OAA4B,GAAoC,EAAA;AAChE,EAAA,CAAC,OAAO,GAAG,CAAA,GAAI,eAAgB,CAAA,KAAA,EAAO,KAAK,sBAAsB,CAAA;AAEjE,EAAA,uBAAQ,GAAA,CAAA,WAAA,EAAA,EAAa,GAAG,KAAA,EAAO,GAAU,EAAA,CAAA;AAC3C,CAAC","file":"aria.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {\n type ForwardedRef,\n type ReactNode,\n type RefAttributes,\n createContext,\n forwardRef,\n} from 'react';\nimport {\n type ContextValue,\n FieldError,\n Group,\n Header,\n Heading,\n Keyboard,\n Label,\n Section,\n type SectionProps,\n SelectValue,\n type SelectValueProps,\n Separator,\n Text,\n} from 'react-aria-components';\nimport { useContextProps } from '../../hooks';\n\n/**\n * To better align with the guidance from RAC about establishing a unique\n * context for components to avoid conflict of props being provided by RAC\n * and design system components, this wrapping utility accepts an RAC and returns\n * a wrapped version along with the new context for the design system to use\n */\nfunction wrap<P extends object, E extends HTMLElement>(\n Component: (props: P & RefAttributes<E>) => ReactNode,\n) {\n const Context = createContext<ContextValue<P, E>>(null);\n\n return {\n // biome-ignore lint/style/useNamingConvention: intentional\n Component: forwardRef<E, P>(function WrappedComponent(props, ref) {\n [props, ref] = useContextProps(props, ref, Context);\n\n return <Component {...props} ref={ref} />;\n }),\n Context,\n };\n}\n\nexport const { Component: AriaFieldError, Context: AriaFieldErrorContext } =\n wrap(FieldError);\n\nexport const { Component: AriaGroup, Context: AriaGroupContext } = wrap(Group);\n\nexport const { Component: AriaHeader, Context: AriaHeaderContext } =\n wrap(Header);\n\nexport const { Component: AriaHeading, Context: AriaHeadingContext } =\n wrap(Heading);\n\nexport const { Component: AriaKeyboard, Context: AriaKeyboardContext } =\n wrap(Keyboard);\n\nexport const { Component: AriaLabel, Context: AriaLabelContext } = wrap(Label);\n\nexport const { Component: AriaSeparator, Context: AriaSeparatorContext } =\n wrap(Separator);\n\nexport const { Component: AriaText, Context: AriaTextContext } = wrap(Text);\n\n/**\n * Due to the complexity of types and technical constraints of TS, it's not\n * possible for the above wrapping utility to support components that accept\n * generic parameters. This means that these components must be manually wrapped\n */\n\nexport const AriaSectionContext =\n createContext<ContextValue<SectionProps<object>, HTMLElement>>(null);\n\nexport const AriaSection = forwardRef(function AriaSection<T extends object>(\n props: SectionProps<T>,\n ref: ForwardedRef<HTMLElement>,\n) {\n [props, ref] = useContextProps(props, ref, AriaSectionContext);\n\n return <Section {...props} ref={ref} />;\n});\n\nexport const AriaSelectValueContext =\n createContext<ContextValue<SelectValueProps<object>, HTMLSpanElement>>(null);\n\nexport const AriaSelectValue = forwardRef(function AriaSelectValue<\n T extends object,\n>(props: SelectValueProps<T>, ref: ForwardedRef<HTMLSpanElement>) {\n [props, ref] = useContextProps(props, ref, AriaSelectValueContext);\n\n return <SelectValue {...props} ref={ref} />;\n});\n"]}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { Context } from 'react';
|
|
3
|
-
import * as react_aria_components from 'react-aria-components';
|
|
4
|
-
import { ContextValue } from 'react-aria-components';
|
|
5
|
-
import { ButtonRenderProps, ButtonColors, ButtonMapping, ButtonSizes, ButtonVariants, ButtonProps, LinkButtonProps, ToggleButtonProps } from './types.js';
|
|
6
|
-
import { RenderPropsChildren } from '../../types/react-aria.js';
|
|
7
|
-
import '../../types/props.js';
|
|
8
|
-
import '../icon/types.js';
|
|
9
|
-
|
|
10
|
-
declare const ButtonContext: Context<ContextValue<ButtonProps, HTMLButtonElement>>;
|
|
11
|
-
declare const Button: (props: Omit<react_aria_components.ButtonProps, "children" | "className" | "style"> & {
|
|
12
|
-
children?: RenderPropsChildren<ButtonRenderProps>;
|
|
13
|
-
classNames?: Partial<{
|
|
14
|
-
container: string;
|
|
15
|
-
button: string;
|
|
16
|
-
}> | undefined;
|
|
17
|
-
color?: ButtonColors;
|
|
18
|
-
mapping?: Partial<ButtonMapping>;
|
|
19
|
-
size?: ButtonSizes;
|
|
20
|
-
variant?: ButtonVariants;
|
|
21
|
-
} & react.RefAttributes<HTMLButtonElement>) => react.ReactElement | null;
|
|
22
|
-
declare const LinkButtonContext: Context<ContextValue<LinkButtonProps, HTMLAnchorElement>>;
|
|
23
|
-
declare const LinkButton: (props: Omit<react_aria_components.LinkProps, "children" | "className" | "style"> & {
|
|
24
|
-
children?: RenderPropsChildren<ButtonRenderProps>;
|
|
25
|
-
classNames?: Partial<{
|
|
26
|
-
container: string;
|
|
27
|
-
button: string;
|
|
28
|
-
}> | undefined;
|
|
29
|
-
color?: ButtonColors;
|
|
30
|
-
mapping?: Partial<ButtonMapping>;
|
|
31
|
-
size?: ButtonSizes;
|
|
32
|
-
variant?: ButtonVariants;
|
|
33
|
-
} & react.RefAttributes<HTMLAnchorElement>) => react.ReactElement | null;
|
|
34
|
-
declare const ToggleButtonContext: Context<ContextValue<ToggleButtonProps, HTMLButtonElement>>;
|
|
35
|
-
declare const ToggleButton: (props: Omit<react_aria_components.ToggleButtonProps, "children" | "className" | "style"> & {
|
|
36
|
-
children?: RenderPropsChildren<ButtonRenderProps>;
|
|
37
|
-
classNames?: Partial<{
|
|
38
|
-
container: string;
|
|
39
|
-
button: string;
|
|
40
|
-
}> | undefined;
|
|
41
|
-
color?: ButtonColors;
|
|
42
|
-
mapping?: Partial<ButtonMapping>;
|
|
43
|
-
size?: ButtonSizes;
|
|
44
|
-
variant?: ButtonVariants;
|
|
45
|
-
} & react.RefAttributes<HTMLButtonElement>) => react.ReactElement | null;
|
|
46
|
-
|
|
47
|
-
export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext };
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import '../../chunk-PZ5AY32C.js';
|
|
2
|
-
import { noop } from '@accelint/core';
|
|
3
|
-
import { clsx } from 'clsx';
|
|
4
|
-
import { createContext, forwardRef, useMemo, useCallback } from 'react';
|
|
5
|
-
import { Button as Button$1, Link, ToggleButton as ToggleButton$1, Provider } from 'react-aria-components';
|
|
6
|
-
import { useContextProps, useDefaultProps, useTheme } from '../../hooks/index.js';
|
|
7
|
-
import { bodies, surfaces } from '../../styles/index.js';
|
|
8
|
-
import { mergeClassNames, inlineVars, callRenderProps } from '../../utils/index.js';
|
|
9
|
-
import { IconContext } from '../icon/index.js';
|
|
10
|
-
import { buttonClassNames, buttonStateVars } from './button.css.js';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
var noopToggleState = { isSelected: false, setSelected: noop, toggle: noop };
|
|
14
|
-
var buttonSizes = ["xs", "sm", "md", "lg", "xl"];
|
|
15
|
-
var defaultMapping = {
|
|
16
|
-
font: bodies,
|
|
17
|
-
icon: buttonSizes.reduce(
|
|
18
|
-
(acc, size) => {
|
|
19
|
-
acc[size] = { size };
|
|
20
|
-
return acc;
|
|
21
|
-
},
|
|
22
|
-
{}
|
|
23
|
-
)
|
|
24
|
-
};
|
|
25
|
-
function useButton(props, ref, context, key) {
|
|
26
|
-
[props, ref] = useContextProps(props, ref, context);
|
|
27
|
-
props = useDefaultProps(props, key);
|
|
28
|
-
const {
|
|
29
|
-
children: childrenProp,
|
|
30
|
-
classNames: classNamesProp,
|
|
31
|
-
color = "primary",
|
|
32
|
-
mapping: mappingProp,
|
|
33
|
-
size = "md",
|
|
34
|
-
variant = "solid",
|
|
35
|
-
...rest
|
|
36
|
-
} = props;
|
|
37
|
-
const theme = useTheme();
|
|
38
|
-
const mapping = useMemo(
|
|
39
|
-
() => ({
|
|
40
|
-
...defaultMapping,
|
|
41
|
-
...mappingProp
|
|
42
|
-
}),
|
|
43
|
-
[mappingProp]
|
|
44
|
-
);
|
|
45
|
-
const classNames = useMemo(
|
|
46
|
-
() => mergeClassNames(buttonClassNames, theme.Button, classNamesProp, {
|
|
47
|
-
button: clsx(
|
|
48
|
-
mapping.font[size],
|
|
49
|
-
variant === "floating" && surfaces.default.proud
|
|
50
|
-
)
|
|
51
|
-
}),
|
|
52
|
-
[theme.Button, classNamesProp, mapping.font, size, variant]
|
|
53
|
-
);
|
|
54
|
-
const style = useCallback(
|
|
55
|
-
(renderProps) => inlineVars(buttonStateVars, {
|
|
56
|
-
isCurrent: false,
|
|
57
|
-
isSelected: false,
|
|
58
|
-
...renderProps,
|
|
59
|
-
color,
|
|
60
|
-
size,
|
|
61
|
-
variant
|
|
62
|
-
}),
|
|
63
|
-
[color, size, variant]
|
|
64
|
-
);
|
|
65
|
-
const values = useMemo(() => [[IconContext, mapping.icon[size]]], [mapping.icon, size]);
|
|
66
|
-
const children = useCallback(
|
|
67
|
-
(renderProps) => /* @__PURE__ */ jsx(Provider, { values, children: /* @__PURE__ */ jsx("span", { className: classNames?.button, children: callRenderProps(childrenProp, {
|
|
68
|
-
state: noopToggleState,
|
|
69
|
-
isCurrent: false,
|
|
70
|
-
isPending: false,
|
|
71
|
-
isSelected: false,
|
|
72
|
-
...renderProps
|
|
73
|
-
}) }) }),
|
|
74
|
-
[values, classNames?.button, childrenProp]
|
|
75
|
-
);
|
|
76
|
-
return useMemo(
|
|
77
|
-
() => ({ ...rest, ref, children, className: classNames?.container, style }),
|
|
78
|
-
[rest, ref, children, classNames?.container, style]
|
|
79
|
-
);
|
|
80
|
-
}
|
|
81
|
-
var ButtonContext = createContext(null);
|
|
82
|
-
var Button = forwardRef(function Button2(props, ref) {
|
|
83
|
-
const buttonProps = useButton(props, ref, ButtonContext, "Button");
|
|
84
|
-
return /* @__PURE__ */ jsx(Button$1, { ...buttonProps });
|
|
85
|
-
});
|
|
86
|
-
var LinkButtonContext = createContext(null);
|
|
87
|
-
var LinkButton = forwardRef(function LinkButton2(props, ref) {
|
|
88
|
-
const buttonProps = useButton(props, ref, LinkButtonContext, "LinkButton");
|
|
89
|
-
return /* @__PURE__ */ jsx(Link, { ...buttonProps });
|
|
90
|
-
});
|
|
91
|
-
var ToggleButtonContext = createContext(null);
|
|
92
|
-
var ToggleButton = forwardRef(function ToggleButton2(props, ref) {
|
|
93
|
-
const buttonProps = useButton(
|
|
94
|
-
props,
|
|
95
|
-
ref,
|
|
96
|
-
ToggleButtonContext,
|
|
97
|
-
"ToggleButton"
|
|
98
|
-
);
|
|
99
|
-
return /* @__PURE__ */ jsx(ToggleButton$1, { ...buttonProps });
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
export { Button, ButtonContext, LinkButton, LinkButtonContext, ToggleButton, ToggleButtonContext };
|
|
103
|
-
//# sourceMappingURL=button.js.map
|
|
104
|
-
//# sourceMappingURL=button.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/button/button.tsx"],"names":["Button","RACButton","LinkButton","ToggleButton","RACToggleButton"],"mappings":";;;;;;;;;;;;AA8CA,IAAM,kBAAkB,EAAE,UAAA,EAAY,OAAO,WAAa,EAAA,IAAA,EAAM,QAAQ,IAAK,EAAA;AAC7E,IAAM,cAA6B,CAAC,IAAA,EAAM,IAAM,EAAA,IAAA,EAAM,MAAM,IAAI,CAAA;AAEhE,IAAM,cAAgC,GAAA;AAAA,EACpC,IAAM,EAAA,MAAA;AAAA,EACN,MAAM,WAAY,CAAA,MAAA;AAAA,IAChB,CAAC,KAAK,IAAS,KAAA;AACb,MAAI,GAAA,CAAA,IAAI,CAAI,GAAA,EAAE,IAAK,EAAA;AAEnB,MAAO,OAAA,GAAA;AAAA,KACT;AAAA,IACA;AAAC;AAEL,CAAA;AAEA,SAAS,SAIP,CAAA,KAAA,EACA,GACA,EAAA,OAAA,EACA,GACA,EAAA;AACA,EAAA,CAAC,OAAO,GAAG,CAA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MAAM,WAAc,GAAA,SAAA,CAAU,KAAO,EAAA,GAAA,EAAK,mBAAmB,YAAY,CAAA;AAEzE,EAAO,uBAAA,GAAA,CAAC,IAAM,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAChC,CAAC;AAEY,IAAA,mBAAA,GACX,cAAkE,IAAI;AAEjE,IAAM,YAAe,GAAA,UAAA,CAAW,SAASC,aAAAA,CAC9C,OACA,GACA,EAAA;AACA,EAAA,MAAM,WAAc,GAAA,SAAA;AAAA,IAClB,KAAA;AAAA,IACA,GAAA;AAAA,IACA,mBAAA;AAAA,IACA;AAAA,GACF;AAEA,EAAO,uBAAA,GAAA,CAACC,cAAiB,EAAA,EAAA,GAAG,WAAa,EAAA,CAAA;AAC3C,CAAC","file":"button.js","sourcesContent":["/*\n * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport { noop } from '@accelint/core';\nimport { clsx } from 'clsx';\nimport {\n type Context,\n type ForwardedRef,\n createContext,\n forwardRef,\n useCallback,\n useMemo,\n} from 'react';\nimport {\n type ButtonRenderProps,\n type ContextValue,\n Link,\n type LinkRenderProps,\n Provider,\n Button as RACButton,\n ToggleButton as RACToggleButton,\n type ToggleButtonRenderProps,\n} from 'react-aria-components';\nimport { useContextProps, useDefaultProps, useTheme } from '../../hooks';\nimport { bodies, surfaces } from '../../styles';\nimport type { OmitProtectedProps } from '../../types';\nimport { callRenderProps, inlineVars, mergeClassNames } from '../../utils';\nimport { IconContext, type IconProps } from '../icon';\nimport { buttonClassNames, buttonStateVars } from './button.css';\nimport type {\n ButtonMapping,\n ButtonProps,\n ButtonSizes,\n LinkButtonProps,\n ToggleButtonProps,\n} from './types';\n\nconst noopToggleState = { isSelected: false, setSelected: noop, toggle: noop };\nconst buttonSizes: ButtonSizes[] = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst defaultMapping: ButtonMapping = {\n font: bodies,\n icon: buttonSizes.reduce(\n (acc, size) => {\n acc[size] = { size };\n\n return acc;\n },\n {} as Record<ButtonSizes, OmitProtectedProps<IconProps>>,\n ),\n};\n\nfunction useButton<\n P extends ButtonProps | LinkButtonProps | ToggleButtonProps,\n E extends HTMLElement,\n>(\n props: P,\n ref: ForwardedRef<E>,\n context: Context<ContextValue<P, E>>,\n key: 'Button' | 'LinkButton' | 'ToggleButton',\n) {\n [props, ref] = useContextProps(props, ref, context);\n\n props = useDefaultProps(props, key);\n\n const {\n children: childrenProp,\n classNames: classNamesProp,\n color = 'primary',\n mapping: mappingProp,\n size = 'md',\n variant = 'solid',\n ...rest\n } = props;\n\n const theme = useTheme();\n\n const mapping = useMemo(\n () => ({\n ...defaultMapping,\n ...mappingProp,\n }),\n [mappingProp],\n );\n\n const classNames = useMemo(\n () =>\n mergeClassNames(buttonClassNames, theme.Button, classNamesProp, {\n button: clsx(\n mapping.font[size],\n variant === 'floating' && surfaces.default.proud,\n ),\n }),\n [theme.Button, classNamesProp, mapping.font, size, variant],\n );\n\n const style = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) =>\n inlineVars(buttonStateVars, {\n isCurrent: false,\n isSelected: false,\n ...renderProps,\n color,\n size,\n variant,\n }),\n [color, size, variant],\n );\n\n const values = useMemo<\n [[typeof IconContext, ContextValue<IconProps, HTMLDivElement>]]\n >(() => [[IconContext, mapping.icon[size]]], [mapping.icon, size]);\n\n const children = useCallback(\n (\n renderProps:\n | ButtonRenderProps\n | LinkRenderProps\n | ToggleButtonRenderProps,\n ) => (\n <Provider values={values}>\n <span className={classNames?.button}>\n {callRenderProps(childrenProp, {\n state: noopToggleState,\n isCurrent: false,\n isPending: false,\n isSelected: false,\n ...renderProps,\n })}\n </span>\n </Provider>\n ),\n [values, classNames?.button, childrenProp],\n );\n\n return useMemo(\n () => ({ ...rest, ref, children, className: classNames?.container, style }),\n [rest, ref, children, classNames?.container, style],\n );\n}\n\nexport const ButtonContext =\n createContext<ContextValue<ButtonProps, HTMLButtonElement>>(null);\n\nexport const Button = forwardRef(function Button(\n props: ButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const buttonProps = useButton(props, ref, ButtonContext, 'Button');\n\n return <RACButton {...buttonProps} />;\n});\n\nexport const LinkButtonContext =\n createContext<ContextValue<LinkButtonProps, HTMLAnchorElement>>(null);\n\nexport const LinkButton = forwardRef(function LinkButton(\n props: LinkButtonProps,\n ref: ForwardedRef<HTMLAnchorElement>,\n) {\n const buttonProps = useButton(props, ref, LinkButtonContext, 'LinkButton');\n\n return <Link {...buttonProps} />;\n});\n\nexport const ToggleButtonContext =\n createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>(null);\n\nexport const ToggleButton = forwardRef(function ToggleButton(\n props: ToggleButtonProps,\n ref: ForwardedRef<HTMLButtonElement>,\n) {\n const buttonProps = useButton(\n props,\n ref,\n ToggleButtonContext,\n 'ToggleButton',\n );\n\n return <RACToggleButton {...buttonProps} />;\n});\n"]}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as _react_types_shared from '@react-types/shared';
|
|
2
|
-
import { CheckboxRenderProps, CheckboxClassNames, CheckboxAlignment, CheckboxProps, CheckboxGroupRenderProps, CheckboxGroupProps } from './types.js';
|
|
3
|
-
import * as react from 'react';
|
|
4
|
-
import * as react_aria_components from 'react-aria-components';
|
|
5
|
-
import { ContextValue } from 'react-aria-components';
|
|
6
|
-
import { RenderPropsChildren } from '../../types/react-aria.js';
|
|
7
|
-
import 'type-fest';
|
|
8
|
-
import '../icon/types.js';
|
|
9
|
-
|
|
10
|
-
declare const CheckboxContext: react.Context<ContextValue<CheckboxProps, HTMLLabelElement>>;
|
|
11
|
-
declare const Checkbox: (props: Omit<react_aria_components.CheckboxProps, "children" | "className" | "style"> & {
|
|
12
|
-
children?: RenderPropsChildren<CheckboxRenderProps>;
|
|
13
|
-
label?: string;
|
|
14
|
-
classNames?: CheckboxClassNames;
|
|
15
|
-
alignInput?: CheckboxAlignment;
|
|
16
|
-
} & react.RefAttributes<HTMLLabelElement>) => react.ReactElement | null;
|
|
17
|
-
declare const CheckboxGroupContext: react.Context<ContextValue<CheckboxGroupProps, HTMLDivElement>>;
|
|
18
|
-
declare const CheckboxGroup: (props: Omit<react_aria_components.CheckboxGroupProps, "children" | "className" | "style"> & {
|
|
19
|
-
children?: RenderPropsChildren<CheckboxGroupRenderProps>;
|
|
20
|
-
classNames?: CheckboxClassNames;
|
|
21
|
-
label?: string;
|
|
22
|
-
orientation?: _react_types_shared.Orientation;
|
|
23
|
-
} & Pick<{
|
|
24
|
-
children?: RenderPropsChildren<CheckboxRenderProps>;
|
|
25
|
-
label?: string;
|
|
26
|
-
classNames?: CheckboxClassNames;
|
|
27
|
-
alignInput?: CheckboxAlignment;
|
|
28
|
-
}, "alignInput"> & react.RefAttributes<HTMLDivElement>) => react.ReactElement | null;
|
|
29
|
-
|
|
30
|
-
export { Checkbox, CheckboxContext, CheckboxGroup, CheckboxGroupContext };
|