@workday/canvas-kit-docs 11.0.0-alpha.795-next.0 → 11.0.0-alpha.796-next.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.
Files changed (2) hide show
  1. package/dist/es6/lib/docs.js +144 -69
  2. package/package.json +6 -6
@@ -253837,7 +253837,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
253837
253837
  },
253838
253838
  {
253839
253839
  "kind": "property",
253840
- "name": "variables",
253840
+ "name": "names",
253841
253841
  "required": true,
253842
253842
  "type": {
253843
253843
  "kind": "external",
@@ -253854,10 +253854,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
253854
253854
  }
253855
253855
  ]
253856
253856
  },
253857
- "description": "",
253857
+ "description": "Name and value pairs for things that cannot be statically resolved via the type system. The\nname is resolved via `getPropertyAccessExpressionText` and the value can be anything. It should\nbe whatever you want the runtime value to be, which is usually a hash. For example:\n\n```ts\nconst myVars = createVars('color');\n\ncolor: myVars.color\n```\n\nThe type of `myVars.color` is `string`, but both in runtime and transpile time, the\n`myVars.color` is resolved to a hard value. The `names` cache is a lookup to that value. The\n`names` cache does not track the AST of `color`, so `const {color} = myVars` will not work. The\nkey comes from `getPropertyAccessExpressionText` which replaces `.` with `-`.",
253858
253858
  "declarations": [
253859
253859
  {
253860
- "name": "variables",
253860
+ "name": "names",
253861
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
253862
+ }
253863
+ ],
253864
+ "tags": {}
253865
+ },
253866
+ {
253867
+ "kind": "property",
253868
+ "name": "extractedNames",
253869
+ "required": true,
253870
+ "type": {
253871
+ "kind": "external",
253872
+ "name": "Record",
253873
+ "url": "https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type",
253874
+ "typeParameters": [
253875
+ {
253876
+ "kind": "primitive",
253877
+ "value": "string"
253878
+ },
253879
+ {
253880
+ "kind": "primitive",
253881
+ "value": "string"
253882
+ }
253883
+ ]
253884
+ },
253885
+ "description": "Extracted names is a mapping from `names` to a value that will be output to CSS. If you add an\nentry to `names`, add an entry to `extractedNames` where the `key` of `extractedNames` is the\n`value` of `names`.\n\nFor example:\n```ts\n// names\n{ \"myVars.foo\": \"--css-12345\" },\n// extractedNames\n{ \"--css-12345\": \"--css-my-vars-foo\" }\n```\n\nThe value in `names` will be used for transformation of TypeScript files into JavaScript files.\nThe `extractedNames` will be used for the output CSS files.",
253886
+ "declarations": [
253887
+ {
253888
+ "name": "extractedNames",
253861
253889
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
253862
253890
  }
253863
253891
  ],
@@ -253865,16 +253893,16 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
253865
253893
  },
253866
253894
  {
253867
253895
  "kind": "property",
253868
- "name": "variableScope",
253896
+ "name": "nameScope",
253869
253897
  "required": false,
253870
253898
  "type": {
253871
253899
  "kind": "primitive",
253872
253900
  "value": "string"
253873
253901
  },
253874
- "description": "Variable scoping allows for a variable lookup to match a predefined scope. For example, in\nstencils, the `base` config can take a function with the locally defined variable names.\n\n```ts\nconst myStencil = createStencil({\n vars: {color: 'red'},\n base({color}) {\n return {\n [color]: 'blue'\n }\n }\n})\n```\n\nIn this case, a variable lookup would fail because there's no global variable named `color`.\nThere's a global variable named `my-color` which is the fully-qualified variable name. The\nstencil parser will add `my-` as a variable scoping when processing style attributes for\nvariable lookup purposes.",
253902
+ "description": "Variable scoping allows for a variable lookup to match a predefined scope. For example, in\nstencils, the `base` config can take a function with the locally defined variable names.\n\n```ts\nconst myStencil = createStencil({\n vars: {color: 'red'},\n base({color}) {\n return {\n [color]: 'blue'\n }\n }\n})\n```\n\nIn this case, a name lookup would fail because there's no global name named `color`. There's a\nglobal name named `my-color` which is the fully-qualified name. The stencil parser will add\n`my-` as a name scoping when processing style attributes for name lookup purposes.",
253875
253903
  "declarations": [
253876
253904
  {
253877
- "name": "variableScope",
253905
+ "name": "nameScope",
253878
253906
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
253879
253907
  }
253880
253908
  ],
@@ -254809,7 +254837,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
254809
254837
  {
254810
254838
  "name": "getFallbackVariable",
254811
254839
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/getFallbackVariable.ts",
254812
- "description": "Looks for a variable value that doesn't include a fallback and automatically adds one if found in\nthe current cache of variables. This allows fallbacks to be automatically included in\nenvironments without the variables defined. This is most useful for Storybook or other sandboxes\nthat may not have CSS Variables defined. The fallbacks will allow the UI to look correct without\nadditional setup. Fallbacks come from the `fallbackFiles` transform configuration.",
254840
+ "description": "Looks for a variable value that doesn't include a fallback and automatically adds one if found in\nthe current cache of names. This allows fallbacks to be automatically included in environments\nwithout the names defined. This is most useful for Storybook or other sandboxes that may not have\nCSS Variables defined. The fallbacks will allow the UI to look correct without additional setup.\nFallbacks come from the `fallbackFiles` transform configuration.",
254813
254841
  "declarations": [
254814
254842
  {
254815
254843
  "name": "getFallbackVariable",
@@ -254840,7 +254868,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
254840
254868
  },
254841
254869
  {
254842
254870
  "kind": "parameter",
254843
- "name": "variables",
254871
+ "name": "names",
254844
254872
  "type": {
254845
254873
  "kind": "external",
254846
254874
  "name": "Record",
@@ -254861,7 +254889,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
254861
254889
  "description": "",
254862
254890
  "declarations": [
254863
254891
  {
254864
- "name": "variables",
254892
+ "name": "names",
254865
254893
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/getFallbackVariable.ts"
254866
254894
  }
254867
254895
  ],
@@ -255096,6 +255124,65 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255096
255124
  "value": "NodeTransformer"
255097
255125
  }
255098
255126
  },
255127
+ {
255128
+ "name": "getClassName",
255129
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleCreateStencil.ts",
255130
+ "description": "",
255131
+ "declarations": [
255132
+ {
255133
+ "name": "getClassName",
255134
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleCreateStencil.ts"
255135
+ }
255136
+ ],
255137
+ "tags": {},
255138
+ "type": {
255139
+ "kind": "function",
255140
+ "parameters": [
255141
+ {
255142
+ "kind": "parameter",
255143
+ "name": "name",
255144
+ "type": {
255145
+ "kind": "primitive",
255146
+ "value": "string"
255147
+ },
255148
+ "required": true,
255149
+ "rest": false,
255150
+ "description": "",
255151
+ "declarations": [
255152
+ {
255153
+ "name": "name",
255154
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleCreateStencil.ts"
255155
+ }
255156
+ ],
255157
+ "tags": {}
255158
+ },
255159
+ {
255160
+ "kind": "parameter",
255161
+ "name": "__1",
255162
+ "type": {
255163
+ "kind": "symbol",
255164
+ "name": "TransformerContext",
255165
+ "value": "TransformerContext"
255166
+ },
255167
+ "required": true,
255168
+ "rest": false,
255169
+ "description": "",
255170
+ "declarations": [
255171
+ {
255172
+ "name": "__1",
255173
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleCreateStencil.ts"
255174
+ }
255175
+ ],
255176
+ "tags": {}
255177
+ }
255178
+ ],
255179
+ "members": [],
255180
+ "returnType": {
255181
+ "kind": "primitive",
255182
+ "value": "string"
255183
+ }
255184
+ }
255185
+ },
255099
255186
  {
255100
255187
  "name": "handleCreateStyles",
255101
255188
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleCreateStyles.ts",
@@ -255457,46 +255544,6 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255457
255544
  }
255458
255545
  }
255459
255546
  },
255460
- {
255461
- "name": "makeEmotionSafe",
255462
- "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/makeEmotionSafe.ts",
255463
- "description": "Util function to fix an issue with Emotion by\nappending `EmotionIssue#3066` to end of css variable\nSee issue: [#3066](https://github.com/emotion-js/emotion/issues/3066)",
255464
- "declarations": [
255465
- {
255466
- "name": "makeEmotionSafe",
255467
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/makeEmotionSafe.ts"
255468
- }
255469
- ],
255470
- "tags": {},
255471
- "type": {
255472
- "kind": "function",
255473
- "parameters": [
255474
- {
255475
- "kind": "parameter",
255476
- "name": "key",
255477
- "type": {
255478
- "kind": "primitive",
255479
- "value": "string"
255480
- },
255481
- "required": true,
255482
- "rest": false,
255483
- "description": "",
255484
- "declarations": [
255485
- {
255486
- "name": "key",
255487
- "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/makeEmotionSafe.ts"
255488
- }
255489
- ],
255490
- "tags": {}
255491
- }
255492
- ],
255493
- "members": [],
255494
- "returnType": {
255495
- "kind": "primitive",
255496
- "value": "string"
255497
- }
255498
- }
255499
- },
255500
255547
  {
255501
255548
  "name": "parseNodeToStaticValue",
255502
255549
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/parseNodeToStaticValue.ts",
@@ -255818,7 +255865,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255818
255865
  },
255819
255866
  {
255820
255867
  "kind": "parameter",
255821
- "name": "variables",
255868
+ "name": "names",
255822
255869
  "type": {
255823
255870
  "kind": "external",
255824
255871
  "name": "Record",
@@ -255839,7 +255886,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255839
255886
  "description": "",
255840
255887
  "declarations": [
255841
255888
  {
255842
- "name": "variables",
255889
+ "name": "names",
255843
255890
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/parseObjectToStaticValue.ts"
255844
255891
  }
255845
255892
  ],
@@ -255971,7 +256018,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255971
256018
  },
255972
256019
  {
255973
256020
  "kind": "property",
255974
- "name": "variables",
256021
+ "name": "names",
255975
256022
  "required": true,
255976
256023
  "type": {
255977
256024
  "kind": "external",
@@ -255988,10 +256035,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255988
256035
  }
255989
256036
  ]
255990
256037
  },
255991
- "description": "",
256038
+ "description": "Name and value pairs for things that cannot be statically resolved via the type system. The\nname is resolved via `getPropertyAccessExpressionText` and the value can be anything. It should\nbe whatever you want the runtime value to be, which is usually a hash. For example:\n\n```ts\nconst myVars = createVars('color');\n\ncolor: myVars.color\n```\n\nThe type of `myVars.color` is `string`, but both in runtime and transpile time, the\n`myVars.color` is resolved to a hard value. The `names` cache is a lookup to that value. The\n`names` cache does not track the AST of `color`, so `const {color} = myVars` will not work. The\nkey comes from `getPropertyAccessExpressionText` which replaces `.` with `-`.",
255992
256039
  "declarations": [
255993
256040
  {
255994
- "name": "variables",
256041
+ "name": "names",
256042
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
256043
+ }
256044
+ ],
256045
+ "tags": {}
256046
+ },
256047
+ {
256048
+ "kind": "property",
256049
+ "name": "extractedNames",
256050
+ "required": true,
256051
+ "type": {
256052
+ "kind": "external",
256053
+ "name": "Record",
256054
+ "url": "https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type",
256055
+ "typeParameters": [
256056
+ {
256057
+ "kind": "primitive",
256058
+ "value": "string"
256059
+ },
256060
+ {
256061
+ "kind": "primitive",
256062
+ "value": "string"
256063
+ }
256064
+ ]
256065
+ },
256066
+ "description": "Extracted names is a mapping from `names` to a value that will be output to CSS. If you add an\nentry to `names`, add an entry to `extractedNames` where the `key` of `extractedNames` is the\n`value` of `names`.\n\nFor example:\n```ts\n// names\n{ \"myVars.foo\": \"--css-12345\" },\n// extractedNames\n{ \"--css-12345\": \"--css-my-vars-foo\" }\n```\n\nThe value in `names` will be used for transformation of TypeScript files into JavaScript files.\nThe `extractedNames` will be used for the output CSS files.",
256067
+ "declarations": [
256068
+ {
256069
+ "name": "extractedNames",
255995
256070
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
255996
256071
  }
255997
256072
  ],
@@ -255999,16 +256074,16 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255999
256074
  },
256000
256075
  {
256001
256076
  "kind": "property",
256002
- "name": "variableScope",
256077
+ "name": "nameScope",
256003
256078
  "required": false,
256004
256079
  "type": {
256005
256080
  "kind": "primitive",
256006
256081
  "value": "string"
256007
256082
  },
256008
- "description": "Variable scoping allows for a variable lookup to match a predefined scope. For example, in\nstencils, the `base` config can take a function with the locally defined variable names.\n\n```ts\nconst myStencil = createStencil({\n vars: {color: 'red'},\n base({color}) {\n return {\n [color]: 'blue'\n }\n }\n})\n```\n\nIn this case, a variable lookup would fail because there's no global variable named `color`.\nThere's a global variable named `my-color` which is the fully-qualified variable name. The\nstencil parser will add `my-` as a variable scoping when processing style attributes for\nvariable lookup purposes.",
256083
+ "description": "Variable scoping allows for a variable lookup to match a predefined scope. For example, in\nstencils, the `base` config can take a function with the locally defined variable names.\n\n```ts\nconst myStencil = createStencil({\n vars: {color: 'red'},\n base({color}) {\n return {\n [color]: 'blue'\n }\n }\n})\n```\n\nIn this case, a name lookup would fail because there's no global name named `color`. There's a\nglobal name named `my-color` which is the fully-qualified name. The stencil parser will add\n`my-` as a name scoping when processing style attributes for name lookup purposes.",
256009
256084
  "declarations": [
256010
256085
  {
256011
- "name": "variableScope",
256086
+ "name": "nameScope",
256012
256087
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
256013
256088
  }
256014
256089
  ],
@@ -257186,7 +257261,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257186
257261
  {
257187
257262
  "name": "CsVarsMap",
257188
257263
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257189
- "description": "CSS variable map type. In developer/dynamic mode, we don't know what the hash is going to be. All\nvariables will look like `--{hash}-{name}`. But the static optimizers generates the name based on\nthe AST, so the `id` will be known. Instead of something like `--abc123-color`, the `ID` is set\nby the optimizer.\n\nFor example:\n```ts\n// dynamic\nconst myVars = createVars('color') // type is `Record<'color', string>`\n\n// optimizer rewrites the code\nconst myVars = createVars<'color', 'myVars'>('color')\n// type is now `{color: \"--myVars-color\"}`\n\nmyVars.color // type is `--myVars-color`\n```\n\nThis is so optimized variables can be used directly by the static parser downstream. The variable\nnames become statically analyzable.",
257264
+ "description": "CSS variable map type. In developer/dynamic mode, we don't know what the hash is going to be. All\nvariables will look like `--{hash}-{name}`. But the static optimizers generates the name based on\nthe AST, so the `id` will be known. Instead of something like `--abc123-color`, the `ID` is set\nby the optimizer.\n\nFor example:\n```ts\n// dynamic\nconst myVars = createVars('color') // type is `Record<'color', string>`\n\n// optimizer rewrites the code\nconst myVars = createVars<'color', 'myVars'>('color')\n// type is now `{color: \"--color-myVars\"}`\n\nmyVars.color // type is `--color-myVars`\n```\n\nThis is so optimized variables can be used directly by the static parser downstream. The variable\nnames become statically analyzable.",
257190
257265
  "declarations": [
257191
257266
  {
257192
257267
  "name": "CsVarsMap",
@@ -257263,7 +257338,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257263
257338
  "falseType": {
257264
257339
  "kind": "unknown",
257265
257340
  "value": "unknown",
257266
- "text": "{[K in T]: `--${ID}-${MakeEmotionSafe<K>}`}"
257341
+ "text": "{[K in T]: `--${K}-${ID}`}"
257267
257342
  }
257268
257343
  }
257269
257344
  }
@@ -257339,7 +257414,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257339
257414
  {
257340
257415
  "name": "cssVar",
257341
257416
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257342
- "description": "Take a CSS Variable name and return a variable property\n\n```ts\nconst myVars = createVars('color')\n\nconst myStyles = createStyles({\n color: cssVar(myVars.color) // color: 'var(--{hash}-color)'\n})\n```\n\nIt can also support an optional fallback. Fallbacks should only be used if it is reasonable to\nexpect a CSS variable isn't defined.\n```ts\nconst myStyles = createStyles({\n color: cssVar(myVars.color, 'red') // color: 'var(--{hash}-color, red)'\n})\n```\n\nIf the project is set up for parsing with fallback files, a fallback will automatically be filled\nduring the parsing phase. This is helpful for cases when CSS variables are expected, but not set\nin the environment.",
257417
+ "description": "Take a CSS Variable name and return a variable property\n\n```ts\nconst myVars = createVars('color')\n\nconst myStyles = createStyles({\n color: cssVar(myVars.color) // color: 'var(--color-{hash})'\n})\n```\n\nIt can also support an optional fallback. Fallbacks should only be used if it is reasonable to\nexpect a CSS variable isn't defined.\n```ts\nconst myStyles = createStyles({\n color: cssVar(myVars.color, 'red') // color: 'var(--color-{hash}, red)'\n})\n```\n\nIf the project is set up for parsing with fallback files, a fallback will automatically be filled\nduring the parsing phase. This is helpful for cases when CSS variables are expected, but not set\nin the environment.",
257343
257418
  "declarations": [
257344
257419
  {
257345
257420
  "name": "cssVar",
@@ -257397,7 +257472,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257397
257472
  {
257398
257473
  "name": "createVars",
257399
257474
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257400
- "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--{hash}-color)'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--{hash}-color': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--{hash}-color: red;\" />\n```",
257475
+ "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--color-{hash})'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--color-{hash}': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--color-{hash}: red;\" />\n```",
257401
257476
  "declarations": [
257402
257477
  {
257403
257478
  "name": "createVars",
@@ -257518,7 +257593,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257518
257593
  {
257519
257594
  "name": "createVars",
257520
257595
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257521
- "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--{hash}-color)'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--{hash}-color': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--{hash}-color: red;\" />\n```",
257596
+ "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--color-{hash})'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--color-{hash}': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--color-{hash}: red;\" />\n```",
257522
257597
  "declarations": [
257523
257598
  {
257524
257599
  "name": "createVars",
@@ -257595,7 +257670,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257595
257670
  {
257596
257671
  "name": "createVars",
257597
257672
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257598
- "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--{hash}-color)'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--{hash}-color': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--{hash}-color: red;\" />\n```",
257673
+ "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--color-{hash})'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--color-{hash}': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--color-{hash}: red;\" />\n```",
257599
257674
  "declarations": [
257600
257675
  {
257601
257676
  "name": "createVars",
@@ -257691,7 +257766,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257691
257766
  {
257692
257767
  "name": "createVars",
257693
257768
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257694
- "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--{hash}-color)'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--{hash}-color': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--{hash}-color: red;\" />\n```",
257769
+ "description": "Create temporary CSS variables to use in components. The CSS variable names will\nbe unique at runtime to avoid collisions. The return value is a function and a\nMap. The function can be used to pass in values from JavaScript. The function will\nreturn a map of variable keys to CSS Variable names.\n\n```ts\n// creates a `color` and `background` CSS variable\nconst myVars = createVars('color', 'background')\n\n// 'color' is a typed property. The type is `string`\nconsole.log(myVars.color) // `'var(--color-{hash})'`\n\n// 'color' is a typed property. The type is `string?`\n// The returned object can be assigned to the `style` property of an element\nconsole.log(myVars({ color: 'red' })) // `{'--color-{hash}': 'red'}`\n\nconst div = document.createElement('div')\ndiv.style = myVars({ color: 'red' }) // <div style=\"--color-{hash}: red;\" />\n```",
257695
257770
  "declarations": [
257696
257771
  {
257697
257772
  "name": "createVars",
@@ -257776,7 +257851,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257776
257851
  {
257777
257852
  "name": "DefaultedVarsMapToCSSVarNames",
257778
257853
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257779
- "description": "Maps JS var names to CSS variable names\n\n```ts\n// ID unknown\nDefaultedVarsMapToCSSVarNames<{foo: 'red'}, never> = Record<'foo', string>\n// ID unknown, nested\nDefaultedVarsMapToCSSVarNames<{foo: { bar: 'red' }}> = Record<'foo', Record<'bar', string>>\n\n// ID known\nDefaultedVarsMapToCSSVarNames<{foo: { bar: 'red' }}, 'my-id'> = { foo: '--my-id-red' }\n// ID known, nested\nDefaultedVarsMapToCSSVarNames<{foo: { bar: 'red' }}, 'my-id'> = { foo: { bar: '--my-id-red' }}\n```",
257854
+ "description": "Maps JS var names to CSS variable names\n\n```ts\n// ID unknown\nDefaultedVarsMapToCSSVarNames<{foo: 'red'}, never> = Record<'foo', string>\n// ID unknown, nested\nDefaultedVarsMapToCSSVarNames<{foo: { bar: 'red' }}> = Record<'foo', Record<'bar', string>>\n\n// ID known\nDefaultedVarsMapToCSSVarNames<{foo: { bar: 'red' }}, 'my-id'> = { foo: '--red-my-id' }\n// ID known, nested\nDefaultedVarsMapToCSSVarNames<{foo: { bar: 'red' }}, 'my-id'> = { foo: { bar: '--red-my-id' }}\n```",
257780
257855
  "declarations": [
257781
257856
  {
257782
257857
  "name": "DefaultedVarsMapToCSSVarNames",
@@ -257871,7 +257946,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257871
257946
  "falseType": {
257872
257947
  "kind": "unknown",
257873
257948
  "value": "unknown",
257874
- "text": "{\n [K in keyof V]: V[K] extends Record<string, string>\n ? DefaultedVarsMapToCSSVarNames<V[K], `${ID}-${ToString<K>}`> // TypeScript doesn't know K is a string here and will throw an error, so we have to coerce it\n : CSSVarName<ID, K>;\n }"
257949
+ "text": "{\n [K in keyof V]: V[K] extends Record<string, string>\n ? {[K2 in keyof V[K]]: CSSVarName<`${ToString<K2>}-${ID}`, K>} //DefaultedVarsMapToCSSVarNames<V[K], `${ToString<K>}-${ID}`> // TypeScript doesn't know K is a string here and will throw an error, so we have to coerce it\n : CSSVarName<ID, K>;\n }"
257875
257950
  }
257876
257951
  }
257877
257952
  }
@@ -257879,7 +257954,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257879
257954
  {
257880
257955
  "name": "DefaultedVarsMap",
257881
257956
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
257882
- "description": "Maps CSS var names to defaulted values if possible. If no ID is provided, TypeScript won't know\nthe CSS var name and will return `Record<string, string>`. If the ID is known, a full mapping\nwill be returned.\n\n```ts\n// ID known\nDefaultedVarsMap<{foo: 'red'}, 'my-id'> = { '--my-id-foo': 'red' }\n// ID known, nested\nDefaultedVarsMap<{foo: { bar: 'red' }}, 'my-id'> = { foo: { '--my-id-bar': 'red' }}\n```",
257957
+ "description": "Maps CSS var names to defaulted values if possible. If no ID is provided, TypeScript won't know\nthe CSS var name and will return `Record<string, string>`. If the ID is known, a full mapping\nwill be returned.\n\n```ts\n// ID known\nDefaultedVarsMap<{foo: 'red'}, 'my-id'> = { '--foo-my-id': 'red' }\n// ID known, nested\nDefaultedVarsMap<{foo: { bar: 'red' }}, 'my-id'> = { foo: { '--bar-my-id': 'red' }}\n```",
257883
257958
  "declarations": [
257884
257959
  {
257885
257960
  "name": "DefaultedVarsMap",
@@ -258434,7 +258509,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
258434
258509
  {
258435
258510
  "name": "csToProps",
258436
258511
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
258437
- "description": "A function that takes in a single input, or an array. The type of the input is either:\n\n- `string` - it represents a CSS class name\n- `undefined` - there is no value. This is provided for convenience for developers to not have to\n filter out undefined\n- `{--{hash}-{varName}: {value}}` - a `Map` of CSS variable to values\n- `{style: ..., className: ...}` an object already returned by another `csToProps` function call\n (for nesting)\n- An array containing any of the above. This will recurse over each entry to produce a single,\n reduced `{style: ..., className: ...}` object",
258512
+ "description": "A function that takes in a single input, or an array. The type of the input is either:\n\n- `string` - it represents a CSS class name\n- `undefined` - there is no value. This is provided for convenience for developers to not have to\n filter out undefined\n- `{--{varName}-{hash}: {value}}` - a `Map` of CSS variable to values\n- `{style: ..., className: ...}` an object already returned by another `csToProps` function call\n (for nesting)\n- An array containing any of the above. This will recurse over each entry to produce a single,\n reduced `{style: ..., className: ...}` object",
258438
258513
  "declarations": [
258439
258514
  {
258440
258515
  "name": "csToProps",
@@ -258967,7 +259042,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
258967
259042
  "kind": "generic",
258968
259043
  "name": "V"
258969
259044
  },
258970
- "description": "A stencil can support CSS variables. Since CSS variables cascade by default, variables are\ndefined with defaults. These defaults are added automatically to the `base` styles to prevent\nCSS variables defined higher in the DOM tree from cascading into a component.\n\n```ts\nconst buttonStencil = createStencil({\n vars: {color: 'red'},\n base: {padding: 5}\n})\n```\n\n```css\n.css-button {\n --css-button-color: red;\n padding: 5px;\n}\n```\n\nAccess to variables in `base` and `modifiers` is done via a function wrapper that gives\nall variables.\n\n```ts\nconst buttonStencil = createStyles({\n vars: {color: 'red'},\n base({color}) {\n return {color: color}\n }\n})\n```\n\n```css\n.css-button {\n --css-button-color: red;\n color: var(--css-button-color);\n}\n```",
259045
+ "description": "A stencil can support CSS variables. Since CSS variables cascade by default, variables are\ndefined with defaults. These defaults are added automatically to the `base` styles to prevent\nCSS variables defined higher in the DOM tree from cascading into a component.\n\n```ts\nconst buttonStencil = createStencil({\n vars: {color: 'red'},\n base: {padding: 5}\n})\n```\n\n```css\n.css-button {\n --css-button-color: red;\n padding: 5px;\n}\n```\n\nAccess to variables in `base` and `modifiers` is done via a function wrapper that gives\nall variables.\n\n```ts\nconst buttonStencil = createStyles({\n vars: {color: 'red'},\n base({color}) {\n return {color: color}\n }\n})\n```\n\n```css\n.css-button {\n --color-button: red;\n color: var(--color-button);\n}\n```",
258971
259046
  "declarations": [
258972
259047
  {
258973
259048
  "name": "vars",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-docs",
3
- "version": "11.0.0-alpha.795-next.0",
3
+ "version": "11.0.0-alpha.796-next.0",
4
4
  "description": "Documentation components of Canvas Kit components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -44,10 +44,10 @@
44
44
  "dependencies": {
45
45
  "@emotion/styled": "^11.6.0",
46
46
  "@storybook/csf": "0.0.1",
47
- "@workday/canvas-kit-labs-react": "^11.0.0-alpha.795-next.0",
48
- "@workday/canvas-kit-preview-react": "^11.0.0-alpha.795-next.0",
49
- "@workday/canvas-kit-react": "^11.0.0-alpha.795-next.0",
50
- "@workday/canvas-kit-styling": "^11.0.0-alpha.795-next.0",
47
+ "@workday/canvas-kit-labs-react": "^11.0.0-alpha.796-next.0",
48
+ "@workday/canvas-kit-preview-react": "^11.0.0-alpha.796-next.0",
49
+ "@workday/canvas-kit-react": "^11.0.0-alpha.796-next.0",
50
+ "@workday/canvas-kit-styling": "^11.0.0-alpha.796-next.0",
51
51
  "@workday/canvas-system-icons-web": "^3.0.0",
52
52
  "@workday/canvas-tokens-web": "^1.3.1",
53
53
  "markdown-to-jsx": "^6.10.3",
@@ -59,5 +59,5 @@
59
59
  "mkdirp": "^1.0.3",
60
60
  "typescript": "4.2"
61
61
  },
62
- "gitHead": "3762ebcef04e77d2e53ebef07dbfeb4fd48481de"
62
+ "gitHead": "2313244746a317a77b62512a32c6967fda5374e3"
63
63
  }