@workday/canvas-kit-docs 11.0.0-alpha.795-next.0 → 11.0.0-alpha.797-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 +253 -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",
@@ -255233,6 +255320,75 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255233
255320
  "value": "NodeTransformer"
255234
255321
  }
255235
255322
  },
255323
+ {
255324
+ "name": "handleParentModifier",
255325
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleParentModifier.ts",
255326
+ "description": "",
255327
+ "declarations": [
255328
+ {
255329
+ "name": "handleParentModifier",
255330
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handleParentModifier.ts"
255331
+ }
255332
+ ],
255333
+ "tags": {},
255334
+ "type": {
255335
+ "kind": "function",
255336
+ "parameters": [
255337
+ {
255338
+ "kind": "parameter",
255339
+ "name": "node",
255340
+ "type": {
255341
+ "kind": "symbol",
255342
+ "name": "ts.Node",
255343
+ "value": "Node"
255344
+ },
255345
+ "required": true,
255346
+ "rest": false,
255347
+ "description": "",
255348
+ "declarations": [
255349
+ {
255350
+ "name": "node",
255351
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
255352
+ }
255353
+ ],
255354
+ "tags": {}
255355
+ },
255356
+ {
255357
+ "kind": "parameter",
255358
+ "name": "context",
255359
+ "type": {
255360
+ "kind": "symbol",
255361
+ "name": "TransformerContext",
255362
+ "value": "TransformerContext"
255363
+ },
255364
+ "required": true,
255365
+ "rest": false,
255366
+ "description": "",
255367
+ "declarations": [
255368
+ {
255369
+ "name": "context",
255370
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
255371
+ }
255372
+ ],
255373
+ "tags": {}
255374
+ }
255375
+ ],
255376
+ "members": [],
255377
+ "returnType": {
255378
+ "kind": "union",
255379
+ "value": [
255380
+ {
255381
+ "kind": "primitive",
255382
+ "value": "string"
255383
+ },
255384
+ {
255385
+ "kind": "primitive",
255386
+ "value": "void"
255387
+ }
255388
+ ]
255389
+ }
255390
+ }
255391
+ },
255236
255392
  {
255237
255393
  "name": "handlePx2Rem",
255238
255394
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/handlePx2Rem.ts",
@@ -255457,46 +255613,6 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255457
255613
  }
255458
255614
  }
255459
255615
  },
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
255616
  {
255501
255617
  "name": "parseNodeToStaticValue",
255502
255618
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/parseNodeToStaticValue.ts",
@@ -255818,7 +255934,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255818
255934
  },
255819
255935
  {
255820
255936
  "kind": "parameter",
255821
- "name": "variables",
255937
+ "name": "names",
255822
255938
  "type": {
255823
255939
  "kind": "external",
255824
255940
  "name": "Record",
@@ -255839,7 +255955,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255839
255955
  "description": "",
255840
255956
  "declarations": [
255841
255957
  {
255842
- "name": "variables",
255958
+ "name": "names",
255843
255959
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/parseObjectToStaticValue.ts"
255844
255960
  }
255845
255961
  ],
@@ -255971,7 +256087,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255971
256087
  },
255972
256088
  {
255973
256089
  "kind": "property",
255974
- "name": "variables",
256090
+ "name": "names",
255975
256091
  "required": true,
255976
256092
  "type": {
255977
256093
  "kind": "external",
@@ -255988,10 +256104,10 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255988
256104
  }
255989
256105
  ]
255990
256106
  },
255991
- "description": "",
256107
+ "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
256108
  "declarations": [
255993
256109
  {
255994
- "name": "variables",
256110
+ "name": "names",
255995
256111
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
255996
256112
  }
255997
256113
  ],
@@ -255999,16 +256115,44 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
255999
256115
  },
256000
256116
  {
256001
256117
  "kind": "property",
256002
- "name": "variableScope",
256118
+ "name": "extractedNames",
256119
+ "required": true,
256120
+ "type": {
256121
+ "kind": "external",
256122
+ "name": "Record",
256123
+ "url": "https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type",
256124
+ "typeParameters": [
256125
+ {
256126
+ "kind": "primitive",
256127
+ "value": "string"
256128
+ },
256129
+ {
256130
+ "kind": "primitive",
256131
+ "value": "string"
256132
+ }
256133
+ ]
256134
+ },
256135
+ "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.",
256136
+ "declarations": [
256137
+ {
256138
+ "name": "extractedNames",
256139
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
256140
+ }
256141
+ ],
256142
+ "tags": {}
256143
+ },
256144
+ {
256145
+ "kind": "property",
256146
+ "name": "nameScope",
256003
256147
  "required": false,
256004
256148
  "type": {
256005
256149
  "kind": "primitive",
256006
256150
  "value": "string"
256007
256151
  },
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.",
256152
+ "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
256153
  "declarations": [
256010
256154
  {
256011
- "name": "variableScope",
256155
+ "name": "nameScope",
256012
256156
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling-transform/lib/utils/types.ts"
256013
256157
  }
256014
256158
  ],
@@ -257186,7 +257330,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257186
257330
  {
257187
257331
  "name": "CsVarsMap",
257188
257332
  "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.",
257333
+ "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
257334
  "declarations": [
257191
257335
  {
257192
257336
  "name": "CsVarsMap",
@@ -257263,7 +257407,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257263
257407
  "falseType": {
257264
257408
  "kind": "unknown",
257265
257409
  "value": "unknown",
257266
- "text": "{[K in T]: `--${ID}-${MakeEmotionSafe<K>}`}"
257410
+ "text": "{[K in T]: `--${K}-${ID}`}"
257267
257411
  }
257268
257412
  }
257269
257413
  }
@@ -257339,7 +257483,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257339
257483
  {
257340
257484
  "name": "cssVar",
257341
257485
  "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.",
257486
+ "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
257487
  "declarations": [
257344
257488
  {
257345
257489
  "name": "cssVar",
@@ -257397,7 +257541,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257397
257541
  {
257398
257542
  "name": "createVars",
257399
257543
  "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```",
257544
+ "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
257545
  "declarations": [
257402
257546
  {
257403
257547
  "name": "createVars",
@@ -257518,7 +257662,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257518
257662
  {
257519
257663
  "name": "createVars",
257520
257664
  "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```",
257665
+ "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
257666
  "declarations": [
257523
257667
  {
257524
257668
  "name": "createVars",
@@ -257595,7 +257739,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257595
257739
  {
257596
257740
  "name": "createVars",
257597
257741
  "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```",
257742
+ "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
257743
  "declarations": [
257600
257744
  {
257601
257745
  "name": "createVars",
@@ -257691,7 +257835,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257691
257835
  {
257692
257836
  "name": "createVars",
257693
257837
  "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```",
257838
+ "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
257839
  "declarations": [
257696
257840
  {
257697
257841
  "name": "createVars",
@@ -257776,7 +257920,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257776
257920
  {
257777
257921
  "name": "DefaultedVarsMapToCSSVarNames",
257778
257922
  "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```",
257923
+ "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
257924
  "declarations": [
257781
257925
  {
257782
257926
  "name": "DefaultedVarsMapToCSSVarNames",
@@ -257871,7 +258015,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257871
258015
  "falseType": {
257872
258016
  "kind": "unknown",
257873
258017
  "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 }"
258018
+ "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
258019
  }
257876
258020
  }
257877
258021
  }
@@ -257879,7 +258023,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
257879
258023
  {
257880
258024
  "name": "DefaultedVarsMap",
257881
258025
  "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```",
258026
+ "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
258027
  "declarations": [
257884
258028
  {
257885
258029
  "name": "DefaultedVarsMap",
@@ -258434,7 +258578,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
258434
258578
  {
258435
258579
  "name": "csToProps",
258436
258580
  "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",
258581
+ "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
258582
  "declarations": [
258439
258583
  {
258440
258584
  "name": "csToProps",
@@ -258967,7 +259111,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
258967
259111
  "kind": "generic",
258968
259112
  "name": "V"
258969
259113
  },
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```",
259114
+ "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
259115
  "declarations": [
258972
259116
  {
258973
259117
  "name": "vars",
@@ -259840,6 +259984,46 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
259840
259984
  ]
259841
259985
  }
259842
259986
  },
259987
+ {
259988
+ "name": "parentModifier",
259989
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
259990
+ "description": "This function is used in conjunction with Stencils to get a selector to match the current element\nand a parent modifier. The selector will match a parent element with a modifier applied and the current\nelement. It should be used on the `base` config of a Stencil.\n\n```ts\nconst childStencil = createStencil({\n base: {\n // base styles\n [parentModifier(parentStencil.modifiers.size.large)]: {\n // maybe adjust padding of this element\n }\n }\n})\n```",
259991
+ "declarations": [
259992
+ {
259993
+ "name": "parentModifier",
259994
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts"
259995
+ }
259996
+ ],
259997
+ "tags": {},
259998
+ "type": {
259999
+ "kind": "function",
260000
+ "parameters": [
260001
+ {
260002
+ "kind": "parameter",
260003
+ "name": "value",
260004
+ "type": {
260005
+ "kind": "primitive",
260006
+ "value": "string"
260007
+ },
260008
+ "required": true,
260009
+ "rest": false,
260010
+ "description": "",
260011
+ "declarations": [
260012
+ {
260013
+ "name": "value",
260014
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts"
260015
+ }
260016
+ ],
260017
+ "tags": {}
260018
+ }
260019
+ ],
260020
+ "members": [],
260021
+ "returnType": {
260022
+ "kind": "primitive",
260023
+ "value": "string"
260024
+ }
260025
+ }
260026
+ },
259843
260027
  {
259844
260028
  "name": "createStencil",
259845
260029
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/lib/cs.ts",
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.797-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.797-next.0",
48
+ "@workday/canvas-kit-preview-react": "^11.0.0-alpha.797-next.0",
49
+ "@workday/canvas-kit-react": "^11.0.0-alpha.797-next.0",
50
+ "@workday/canvas-kit-styling": "^11.0.0-alpha.797-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": "78514b9b8a486bc3b361b57a0f5d340a2a86e39d"
63
63
  }