@sanity/ui 3.0.0-static.27 → 3.0.0-static.28
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/README.md +1 -1
- package/dist/_chunks-cjs/_visual-editing.cjs +710 -840
- package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
- package/dist/_chunks-cjs/refractor.cjs +2 -2
- package/dist/_chunks-cjs/refractor.cjs.map +1 -1
- package/dist/_chunks-es/_visual-editing.js +705 -834
- package/dist/_chunks-es/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/refractor.js +1 -1
- package/dist/css/layers.css +4 -0
- package/dist/css/primitives/popover/popover.css +4 -0
- package/dist/css.cjs +58 -49
- package/dist/css.cjs.map +1 -1
- package/dist/css.d.cts +13 -5
- package/dist/css.d.ts +13 -5
- package/dist/css.js +58 -49
- package/dist/css.js.map +1 -1
- package/dist/index.cjs +2006 -1824
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -0
- package/dist/index.d.cts +34 -17
- package/dist/index.d.ts +34 -17
- package/dist/index.js +2002 -1821
- package/dist/index.js.map +1 -1
- package/dist/theme.cjs +7 -7
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js +7 -7
- package/dist/theme.js.map +1 -1
- package/exports/_visual-editing.ts +1 -1
- package/package.json +10 -15
- package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
- package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
- package/src/core/components/autocomplete/autocomplete.tsx +13 -17
- package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
- package/src/core/components/autocomplete/constants.ts +3 -1
- package/src/core/components/autocomplete/types.ts +1 -1
- package/src/core/components/breadcrumbs/breadcrumbs.tsx +8 -3
- package/src/core/components/dialog/__workshop__/activate.tsx +11 -3
- package/src/core/components/dialog/__workshop__/panes.tsx +12 -5
- package/src/core/components/dialog/dialog.tsx +12 -6
- package/src/core/components/dialog/dialogCard.tsx +89 -54
- package/src/core/components/dialog/dialogContext.ts +1 -1
- package/src/core/components/dialog/dialogProvider.tsx +1 -1
- package/src/core/components/dialog/index.ts +1 -0
- package/src/core/components/dialog/isTargetWithinScope.ts +1 -1
- package/src/core/components/hotkeys/hotkeys.tsx +3 -2
- package/src/core/components/menu/__workshop__/avatarMenu.tsx +12 -6
- package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -5
- package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -2
- package/src/core/components/menu/helpers.ts +1 -1
- package/src/core/components/menu/menu.tsx +6 -3
- package/src/core/components/menu/menuButton.tsx +5 -3
- package/src/core/components/menu/menuDivider.tsx +1 -1
- package/src/core/components/menu/menuGroup.tsx +8 -4
- package/src/core/components/menu/menuItem.tsx +4 -2
- package/src/core/components/tab/tab.tsx +2 -2
- package/src/core/components/tab/tabList.tsx +2 -2
- package/src/core/components/tab/tabPanel.tsx +2 -2
- package/src/core/components/toast/toast.tsx +7 -2
- package/src/core/components/toast/toastLayer.tsx +3 -2
- package/src/core/components/toast/toastProvider.tsx +1 -1
- package/src/core/components/tree/tree.tsx +2 -2
- package/src/core/components/tree/treeGroup.tsx +2 -2
- package/src/core/components/tree/treeItem.tsx +13 -6
- package/src/core/components/tree/types.ts +0 -1
- package/src/core/components/virtualList/virtualList.tsx +10 -5
- package/src/core/helpers/focus.ts +0 -8
- package/src/core/hooks/useArrayProp.ts +1 -1
- package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -3
- package/src/core/hooks/useElementSize.ts +1 -1
- package/src/core/hooks/useResponsiveProp.ts +1 -1
- package/src/core/index.ts +83 -7
- package/src/core/observers/{elementSizeObserver.ts → elementSize.ts} +1 -1
- package/src/core/primitives/_selectable/index.ts +1 -0
- package/src/core/primitives/_selectable/selectable.tsx +13 -3
- package/src/core/{types/selectable.ts → primitives/_selectable/types.ts} +1 -1
- package/src/core/primitives/arrow/arrow.tsx +1 -1
- package/src/core/primitives/avatar/avatar.tsx +4 -3
- package/src/core/primitives/avatar/avatarCounter.tsx +3 -3
- package/src/core/primitives/avatar/avatarStack.tsx +4 -4
- package/src/core/primitives/avatar/types.ts +17 -0
- package/src/core/primitives/badge/badge.tsx +2 -1
- package/src/core/primitives/badge/types.ts +11 -2
- package/src/core/primitives/box/__workshop__/responsive.tsx +0 -1
- package/src/core/primitives/box/box.tsx +1 -1
- package/src/core/primitives/box/index.ts +1 -0
- package/src/core/primitives/button/__workshop__/disabled.tsx +37 -51
- package/src/core/primitives/button/__workshop__/index.ts +5 -0
- package/src/core/primitives/button/__workshop__/textOverflow.tsx +13 -0
- package/src/core/primitives/button/button.tsx +15 -14
- package/src/core/primitives/button/index.ts +1 -0
- package/src/core/primitives/card/__workshop__/listNavigation.tsx +2 -2
- package/src/core/primitives/card/card.tsx +1 -1
- package/src/core/primitives/card/types.ts +3 -0
- package/src/core/primitives/checkbox/__workshop__/tones.tsx +9 -1
- package/src/core/primitives/checkbox/checkbox.tsx +3 -4
- package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +17 -42
- package/src/core/primitives/code/code.tsx +1 -1
- package/src/core/primitives/container/container.tsx +1 -1
- package/src/core/primitives/flex/flex.tsx +1 -1
- package/src/core/primitives/flex/index.ts +1 -0
- package/src/core/primitives/grid/grid.tsx +1 -1
- package/src/core/primitives/grid/index.ts +1 -0
- package/src/core/primitives/heading/heading.tsx +1 -1
- package/src/core/primitives/inline/inline.tsx +1 -1
- package/src/core/primitives/kbd/kbd.tsx +1 -1
- package/src/core/primitives/label/label.tsx +1 -1
- package/src/core/primitives/layer/layer.test.tsx +1 -1
- package/src/core/primitives/layer/layer.tsx +2 -2
- package/src/core/primitives/layer/layerCard.tsx +3 -3
- package/src/core/primitives/layer/layerProvider.tsx +2 -1
- package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +12 -10
- package/src/core/primitives/popover/__workshop__/TestStory.tsx +9 -8
- package/src/core/primitives/popover/constants.ts +1 -1
- package/src/core/primitives/popover/floating-ui/size.ts +1 -1
- package/src/core/primitives/popover/popover.tsx +7 -4
- package/src/core/primitives/popover/popoverLayer.tsx +2 -1
- package/src/core/primitives/popover/types.ts +5 -0
- package/src/core/primitives/radio/radio.tsx +2 -2
- package/src/core/primitives/select/select.tsx +2 -2
- package/src/core/{components → primitives}/skeleton/__workshop__/index.ts +1 -1
- package/src/core/{components → primitives}/skeleton/codeSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/headingSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/labelSkeleton.tsx +1 -1
- package/src/core/{components → primitives}/skeleton/skeleton.tsx +7 -8
- package/src/core/{components → primitives}/skeleton/textSkeleton.tsx +1 -1
- package/src/core/primitives/spinner/spinner.tsx +1 -1
- package/src/core/primitives/srOnly/srOnly.tsx +1 -1
- package/src/core/primitives/stack/stack.tsx +1 -1
- package/src/core/primitives/switch/switch.tsx +1 -6
- package/src/core/primitives/text/__workshop__/colored.tsx +2 -2
- package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +17 -42
- package/src/core/primitives/text/text.tsx +3 -1
- package/src/core/primitives/textArea/__workshop__/plain.tsx +2 -2
- package/src/core/primitives/textArea/textArea.tsx +2 -2
- package/src/core/primitives/textInput/textInput.tsx +3 -2
- package/src/core/primitives/tooltip/constants.ts +1 -1
- package/src/core/primitives/tooltip/tooltip.tsx +5 -3
- package/src/core/primitives/tooltip/tooltipLayer.tsx +1 -1
- package/src/core/primitives/types.ts +8 -10
- package/src/core/types/radius.ts +1 -1
- package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +9 -5
- package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
- package/src/core/utils/portal/portal.tsx +1 -1
- package/src/css/components/dialog/dialog.css.ts +26 -1
- package/src/css/components/dialog/dialog.ts +27 -7
- package/src/css/components/skeleton/skeleton.ts +3 -1
- package/src/css/components/skeleton/types.ts +3 -1
- package/src/css/index.ts +75 -5
- package/src/css/primitives/_input/input.ts +2 -1
- package/src/css/primitives/_input/types.ts +2 -1
- package/src/css/primitives/_selectable/_selectable.css.ts +32 -24
- package/src/css/primitives/_selectable/selectable.ts +1 -1
- package/src/css/primitives/_selectable/types.ts +1 -1
- package/src/css/primitives/avatar/avatar.css.ts +8 -4
- package/src/css/primitives/avatar/avatar.ts +1 -1
- package/src/css/primitives/badge/types.ts +0 -2
- package/src/css/primitives/box/box.ts +35 -37
- package/src/css/primitives/box/types.ts +34 -36
- package/src/css/primitives/button/button.css.ts +4 -0
- package/src/css/primitives/button/button.ts +5 -2
- package/src/css/primitives/button/types.ts +4 -11
- package/src/css/primitives/card/__workshop__/color.tsx +70 -0
- package/src/css/primitives/card/__workshop__/index.ts +14 -0
- package/src/css/primitives/card/card.css.ts +4 -0
- package/src/css/primitives/code/code.ts +3 -1
- package/src/css/primitives/code/types.ts +2 -1
- package/src/css/primitives/container/container.ts +3 -1
- package/src/css/primitives/heading/heading.ts +4 -1
- package/src/css/primitives/heading/types.ts +3 -1
- package/src/css/primitives/kbd/kbd.ts +1 -1
- package/src/css/primitives/kbd/types.ts +1 -1
- package/src/css/primitives/label/label.ts +4 -1
- package/src/css/primitives/label/types.ts +3 -1
- package/src/css/primitives/switch/switch.css.ts +1 -1
- package/src/css/primitives/text/text.ts +6 -1
- package/src/css/primitives/text/types.ts +5 -2
- package/src/theme/v3/defaultFonts.ts +6 -6
- package/src/theme/v3/defaultTokens.ts +1 -1
- package/bin/sanity-ui.cjs +0 -5
- package/dist/ui.css +0 -1
- package/src/cli/buildCommand.ts +0 -10
- package/src/cli/index.ts +0 -26
- package/src/core/components/autocomplete/index.ts +0 -2
- package/src/core/components/index.ts +0 -10
- package/src/core/helpers/index.ts +0 -5
- package/src/core/hooks/index.ts +0 -13
- package/src/core/observers/index.ts +0 -2
- package/src/core/primitives/index.ts +0 -30
- package/src/core/types/avatar.ts +0 -16
- package/src/core/types/card.ts +0 -4
- package/src/core/types/index.ts +0 -15
- package/src/core/types/popover.ts +0 -4
- package/src/core/utils/index.ts +0 -4
- package/src/css/__theme/index.ts +0 -16
- package/src/css/__theme/lib/contract/buildVarContract.ts +0 -78
- package/src/css/__theme/lib/contract/index.ts +0 -4
- package/src/css/__theme/lib/contract/types.ts +0 -17
- package/src/css/__theme/resolveTheme.ts +0 -865
- package/src/css/components/index.ts +0 -6
- package/src/css/primitives/index.ts +0 -24
- package/src/css/props/index.ts +0 -37
- package/src/css/utils/srOnly/index.ts +0 -1
- /package/src/core/{global.ts → __DEV__.ts} +0 -0
- /package/src/core/{types/dialog.ts → components/dialog/types.ts} +0 -0
- /package/src/core/observers/{resizeObserver.ts → resize.ts} +0 -0
- /package/src/core/{types/badge.ts → primitives/badge/types2.ts} +0 -0
- /package/src/core/{types/box.ts → primitives/box/types.ts} +0 -0
- /package/src/core/{types/button.ts → primitives/button/types.ts} +0 -0
- /package/src/core/{types/flex.ts → primitives/flex/types.ts} +0 -0
- /package/src/core/{types/grid.ts → primitives/grid/types.ts} +0 -0
- /package/src/core/{components → primitives}/skeleton/__workshop__/delay.tsx +0 -0
- /package/src/core/{components → primitives}/skeleton/__workshop__/skeleton.tsx +0 -0
- /package/src/core/{components → primitives}/skeleton/index.ts +0 -0
- /package/src/core/types/{text.ts → textAlign.ts} +0 -0
- /package/src/css/{utils → primitives/srOnly}/index.ts +0 -0
- /package/src/css/{utils → primitives}/srOnly/srOnly.css.ts +0 -0
- /package/src/css/{utils → primitives}/srOnly/srOnly.ts +0 -0
package/src/cli/buildCommand.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
|
|
3
|
-
import path from 'path'
|
|
4
|
-
|
|
5
|
-
export async function buildCommand(options: {cwd?: string; outDir?: string}): Promise<void> {
|
|
6
|
-
const cwd = options.cwd ?? process.cwd()
|
|
7
|
-
const outDir = options.outDir ?? path.resolve(cwd, 'dist')
|
|
8
|
-
|
|
9
|
-
console.log('TODO: buildCommand', {cwd, outDir})
|
|
10
|
-
}
|
package/src/cli/index.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import {cac} from 'cac'
|
|
2
|
-
|
|
3
|
-
import {version} from '../../package.json'
|
|
4
|
-
|
|
5
|
-
const cli = cac('sanity-ui')
|
|
6
|
-
|
|
7
|
-
cli
|
|
8
|
-
.command('build')
|
|
9
|
-
.option('--cwd [cwd]', 'Working directory')
|
|
10
|
-
.option('--outDir [outDir]', 'Output directory')
|
|
11
|
-
.action(async (options) => {
|
|
12
|
-
const {buildCommand} = await import('./buildCommand')
|
|
13
|
-
|
|
14
|
-
await buildCommand({
|
|
15
|
-
...options,
|
|
16
|
-
cwd: options.cwd || process.cwd(),
|
|
17
|
-
})
|
|
18
|
-
})
|
|
19
|
-
|
|
20
|
-
cli.command('').action(() => {
|
|
21
|
-
cli.outputHelp()
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
cli.help()
|
|
25
|
-
cli.version(version)
|
|
26
|
-
cli.parse()
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export * from './autocomplete'
|
|
2
|
-
export * from './breadcrumbs'
|
|
3
|
-
export * from './dialog'
|
|
4
|
-
export * from './hotkeys'
|
|
5
|
-
export * from './menu'
|
|
6
|
-
export * from './skeleton'
|
|
7
|
-
export * from './tab'
|
|
8
|
-
export * from './toast'
|
|
9
|
-
export * from './tree'
|
|
10
|
-
export * from './virtualList'
|
package/src/core/hooks/index.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export * from './useArrayProp'
|
|
2
|
-
export * from './useClickOutside'
|
|
3
|
-
export * from './useClickOutsideEvent'
|
|
4
|
-
export * from './useCustomValidity'
|
|
5
|
-
export * from './useElementRect'
|
|
6
|
-
export * from './useElementSize'
|
|
7
|
-
export * from './useForwardedRef'
|
|
8
|
-
export * from './useGlobalKeyDown'
|
|
9
|
-
export * from './useMatchMedia'
|
|
10
|
-
export * from './useMediaIndex'
|
|
11
|
-
export * from './usePrefersDark'
|
|
12
|
-
export * from './usePrefersReducedMotion'
|
|
13
|
-
export * from './useResponsiveProp'
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export * from './arrow'
|
|
2
|
-
export * from './avatar'
|
|
3
|
-
export * from './badge'
|
|
4
|
-
export * from './box'
|
|
5
|
-
export * from './button'
|
|
6
|
-
export * from './card'
|
|
7
|
-
export * from './checkbox'
|
|
8
|
-
export * from './code'
|
|
9
|
-
export * from './container'
|
|
10
|
-
export * from './flex'
|
|
11
|
-
export * from './grid'
|
|
12
|
-
export * from './heading'
|
|
13
|
-
export * from './inline'
|
|
14
|
-
export * from './kbd'
|
|
15
|
-
export * from './label'
|
|
16
|
-
export * from './layer'
|
|
17
|
-
export * from './popover'
|
|
18
|
-
export * from './radio'
|
|
19
|
-
export * from './select'
|
|
20
|
-
export * from './spinner'
|
|
21
|
-
export * from './srOnly'
|
|
22
|
-
export * from './stack'
|
|
23
|
-
export * from './switch'
|
|
24
|
-
export * from './text'
|
|
25
|
-
export * from './textArea'
|
|
26
|
-
export * from './textInput'
|
|
27
|
-
export * from './tooltip'
|
|
28
|
-
|
|
29
|
-
// Types
|
|
30
|
-
export * from './types'
|
package/src/core/types/avatar.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/** @deprecated Use `AvatarSize` from `@sanity/ui/theme' instead. */
|
|
3
|
-
type AvatarSize,
|
|
4
|
-
} from '@sanity/ui/theme'
|
|
5
|
-
|
|
6
|
-
/** @public */
|
|
7
|
-
export type AvatarPosition = 'top' | 'bottom' | 'inside'
|
|
8
|
-
|
|
9
|
-
/** @public */
|
|
10
|
-
// export type AvatarSize = 0 | 1 | 2 | 3
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @public
|
|
14
|
-
* @deprecated Will be removed in next major version.
|
|
15
|
-
*/
|
|
16
|
-
export type AvatarStatus = 'online' | 'editing' | 'inactive'
|
package/src/core/types/card.ts
DELETED
package/src/core/types/index.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './avatar'
|
|
2
|
-
export * from './badge'
|
|
3
|
-
export * from './box'
|
|
4
|
-
export * from './button'
|
|
5
|
-
export * from './card'
|
|
6
|
-
export * from './dialog'
|
|
7
|
-
export * from './flex'
|
|
8
|
-
export * from './grid'
|
|
9
|
-
export * from './gridItem'
|
|
10
|
-
export * from './placement'
|
|
11
|
-
export * from './popover'
|
|
12
|
-
export * from './props'
|
|
13
|
-
export * from './radius'
|
|
14
|
-
export * from './selectable'
|
|
15
|
-
export * from './text'
|
package/src/core/utils/index.ts
DELETED
package/src/css/__theme/index.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// import {buildTheme_v3} from '@sanity/ui/theme'
|
|
2
|
-
|
|
3
|
-
// import {resolveTheme} from './resolveTheme'
|
|
4
|
-
|
|
5
|
-
// const result = resolveTheme({theme: buildTheme_v3()})
|
|
6
|
-
|
|
7
|
-
// /** @public */
|
|
8
|
-
// export const vars = result.vars
|
|
9
|
-
|
|
10
|
-
// /** @public */
|
|
11
|
-
// export const varNames = result.varNames
|
|
12
|
-
|
|
13
|
-
// /** @public */
|
|
14
|
-
// export const properties = result.properties
|
|
15
|
-
|
|
16
|
-
export {}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
// import {_hash} from '../../../_hash'
|
|
2
|
-
// import type {Contract, ContractProperties, ContractVarNames, ContractVars} from './types'
|
|
3
|
-
|
|
4
|
-
// export function buildVarContract<C extends Contract, P extends string>(
|
|
5
|
-
// contract: C,
|
|
6
|
-
// options: {layer: string; prefix: P},
|
|
7
|
-
// ) {
|
|
8
|
-
// return {
|
|
9
|
-
// vars: buildVars(contract, options),
|
|
10
|
-
// varNames: buildVarNames(contract, options),
|
|
11
|
-
// properties: buildProperties(contract, options),
|
|
12
|
-
// }
|
|
13
|
-
// }
|
|
14
|
-
|
|
15
|
-
// function buildProperties<C extends Contract, P extends string>(
|
|
16
|
-
// contract: C,
|
|
17
|
-
// options: {layer: string; prefix: P},
|
|
18
|
-
// ) {
|
|
19
|
-
// const _properties: ContractProperties = {}
|
|
20
|
-
|
|
21
|
-
// function walk(c: Contract) {
|
|
22
|
-
// for (const key in c) {
|
|
23
|
-
// if (typeof c[key] === 'string') {
|
|
24
|
-
// _properties[`--${options.prefix}${_hash(`${options.layer}.${c[key]}`)}`] = c[key]
|
|
25
|
-
// } else if (c[key] === null) {
|
|
26
|
-
// // ignore
|
|
27
|
-
// } else {
|
|
28
|
-
// walk(c[key])
|
|
29
|
-
// }
|
|
30
|
-
// }
|
|
31
|
-
// }
|
|
32
|
-
|
|
33
|
-
// walk(contract)
|
|
34
|
-
|
|
35
|
-
// return Object.freeze(_properties)
|
|
36
|
-
// }
|
|
37
|
-
|
|
38
|
-
// function buildVars<C extends Contract, P extends string>(
|
|
39
|
-
// contract: C,
|
|
40
|
-
// options: {layer: string; prefix: P},
|
|
41
|
-
// path: string = '',
|
|
42
|
-
// ) {
|
|
43
|
-
// const _vars = {} as Record<string, unknown>
|
|
44
|
-
|
|
45
|
-
// for (const key in contract) {
|
|
46
|
-
// if (typeof contract[key] === 'string') {
|
|
47
|
-
// _vars[key] = `var(--${options.prefix}${_hash(`${options.layer}.${contract[key]}`)})`
|
|
48
|
-
// } else if (contract[key] === null) {
|
|
49
|
-
// _vars[key] = `var(--${options.prefix}${_hash(`${options.layer}.${path}.${key}`)})`
|
|
50
|
-
// } else {
|
|
51
|
-
// _vars[key] = buildVars(contract[key], options, [path, key].join('.'))
|
|
52
|
-
// }
|
|
53
|
-
// }
|
|
54
|
-
|
|
55
|
-
// return Object.freeze(_vars) as ContractVars<C>
|
|
56
|
-
// }
|
|
57
|
-
|
|
58
|
-
// function buildVarNames<C extends Contract, P extends string>(
|
|
59
|
-
// contract: C,
|
|
60
|
-
// options: {layer: string; prefix: P},
|
|
61
|
-
// path: string = '',
|
|
62
|
-
// ) {
|
|
63
|
-
// const _varNames = {} as Record<string, unknown>
|
|
64
|
-
|
|
65
|
-
// for (const key in contract) {
|
|
66
|
-
// if (typeof contract[key] === 'string') {
|
|
67
|
-
// _varNames[key] = `--${options.prefix}${_hash(`${options.layer}.${contract[key]}`)}`
|
|
68
|
-
// } else if (contract[key] === null) {
|
|
69
|
-
// _varNames[key] = `--${options.prefix}${_hash(`${options.layer}.${path}.${key}`)}`
|
|
70
|
-
// } else {
|
|
71
|
-
// _varNames[key] = buildVarNames(contract[key], options, [path, key].join('.'))
|
|
72
|
-
// }
|
|
73
|
-
// }
|
|
74
|
-
|
|
75
|
-
// return Object.freeze(_varNames) as ContractVarNames<C>
|
|
76
|
-
// }
|
|
77
|
-
|
|
78
|
-
export {}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// export interface Contract {
|
|
2
|
-
// [key: string]: string | Contract | null
|
|
3
|
-
// }
|
|
4
|
-
|
|
5
|
-
// export interface ContractProperties {
|
|
6
|
-
// [key: `--${string}`]: string
|
|
7
|
-
// }
|
|
8
|
-
|
|
9
|
-
// export type ContractVars<C extends Contract> = {
|
|
10
|
-
// [key in keyof C]: C[key] extends object ? ContractVars<C[key]> : `var(--${string})`
|
|
11
|
-
// }
|
|
12
|
-
|
|
13
|
-
// export type ContractVarNames<C extends Contract> = {
|
|
14
|
-
// [key in keyof C]: C[key] extends object ? ContractVarNames<C[key]> : `--${string}`
|
|
15
|
-
// }
|
|
16
|
-
|
|
17
|
-
export {}
|