@zanichelli/albe-web-components 17.2.0 → 17.3.0-RC1
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/CHANGELOG.md +2 -0
- package/dist/cjs/z-app-header_12.cjs.entry.js +517 -483
- package/dist/cjs/z-app-header_12.cjs.entry.js.map +1 -1
- package/dist/cjs/z-dragdrop-area_2.cjs.entry.js.map +1 -1
- package/dist/collection/components/file-upload/z-dragdrop-area/styles.css +2 -1
- package/dist/collection/components/z-input/styles.css +9 -8
- package/dist/collection/constants/iconset.js +516 -482
- package/dist/collection/constants/iconset.js.map +1 -1
- package/dist/collection/utils/storybook-utils.js +1 -1
- package/dist/collection/utils/storybook-utils.js.map +1 -1
- package/dist/components/iconset.js +516 -482
- package/dist/components/iconset.js.map +1 -1
- package/dist/components/index11.js +1 -1
- package/dist/components/index11.js.map +1 -1
- package/dist/components/index7.js.map +1 -1
- package/dist/esm/z-app-header_12.entry.js +517 -483
- package/dist/esm/z-app-header_12.entry.js.map +1 -1
- package/dist/esm/z-dragdrop-area_2.entry.js.map +1 -1
- package/dist/types/constants/iconset.d.ts +1114 -1045
- package/dist/web-components-library/p-0e3ec0b2.entry.js +2 -0
- package/dist/web-components-library/p-0e3ec0b2.entry.js.map +1 -0
- package/dist/web-components-library/p-2dde9b84.entry.js.map +1 -1
- package/dist/web-components-library/web-components-library.esm.js +1 -1
- package/package.json +2 -3
- package/www/build/p-0e3ec0b2.entry.js +2 -0
- package/www/build/p-0e3ec0b2.entry.js.map +1 -0
- package/www/build/p-2dde9b84.entry.js.map +1 -1
- package/www/build/{p-d62054b7.js → p-a0155994.js} +1 -1
- package/www/build/web-components-library.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/web-components-library/p-708bb70c.entry.js +0 -2
- package/dist/web-components-library/p-708bb70c.entry.js.map +0 -1
- package/www/build/p-708bb70c.entry.js +0 -2
- package/www/build/p-708bb70c.entry.js.map +0 -1
|
@@ -107,7 +107,7 @@ export function getThemeTokenValue(themeClass, token) {
|
|
|
107
107
|
const value = (_a = themeStyle.styleMap.get(token)) === null || _a === void 0 ? void 0 : _a[0];
|
|
108
108
|
return value instanceof CSSVariableReferenceValue
|
|
109
109
|
? getComputedStyle(document.documentElement).getPropertyValue(value.variable)
|
|
110
|
-
: (_b = value === null || value === void 0 ? void 0 : value.toString()) !== null && _b !== void 0 ? _b : undefined;
|
|
110
|
+
: ((_b = value === null || value === void 0 ? void 0 : value.toString()) !== null && _b !== void 0 ? _b : undefined);
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
113
113
|
* Get a Storybook Arg config for Design System color tokens.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook-utils.js","sourceRoot":"","sources":["../../../src/utils/storybook-utils.ts"],"names":[],"mappings":"AASA,IAAK,QAQJ;AARD,WAAK,QAAQ;IACX,uBAAW,CAAA;IACX,2BAAe,CAAA;IACf,yBAAa,CAAA;IACb,6BAAiB,CAAA;IACjB,yBAAa,CAAA;IACb,6BAAiB,CAAA;IACjB,+BAAmB,CAAA;AACrB,CAAC,EARI,QAAQ,KAAR,QAAQ,QAQZ;AAED;;GAEG;AACH,SAAS,oBAAoB;IAC3B,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC;SACpC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC9C,MAAM,CAAC,CAAC,IAAI,EAAwB,EAAE,WAAC,OAAA,IAAI,YAAY,YAAY,KAAI,MAAA,IAAI,CAAC,YAAY,0CAAE,QAAQ,CAAC,OAAO,CAAC,CAAA,CAAA,EAAA,CAAC;SAC5G,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;SAClD,MAAM,CAAC,OAAO,CAAC,CAAC;AAC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AW,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO;QACL,OAAO,EAAE,WAAW;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,QAAQ;YACd,MAAM,EAAE,kBAAkB,EAAE;SAC7B;KACa,CAAC;AACnB,CAAC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport {OptionsConfig} from \"@storybook/blocks\";\nimport {Args} from \"@storybook/web-components\";\n\ntype CSSCustomProp = `--${string}`;\ntype EnsurePrefix<T extends string, P extends string> = T extends `${P}${string}` ? T : `${P}${T}`;\n\nexport type CSSVarsArguments<T extends string = string> = {[x in EnsurePrefix<T, \"--\">]: string};\n\nenum PALETTES {\n RED = \"red\",\n GREEN = \"green\",\n BLUE = \"blue\",\n YELLOW = \"yellow\",\n GRAY = \"gray\",\n AVATAR = \"avatar\",\n SUBJECT = \"subject\",\n}\n\n/**\n * Get all root CSS properties.\n */\nfunction getRootCssProperties(): string[] {\n return Array.from(document.styleSheets)\n .flatMap((sheet) => Array.from(sheet.cssRules))\n .filter((rule): rule is CSSStyleRule => rule instanceof CSSStyleRule && rule.selectorText?.includes(\":root\"))\n .flatMap((rule) => Object.values(rule.style || {}))\n .filter(Boolean);\n}\n\n/**\n * Get Design System color tokens.\n * Can be used in components stories controls as follows:\n * @example ```\n * argTypes={{\n * \"--z-component--background-color\": {\n * control: {type: \"select\"},\n * options: getColorTokens(),\n * }\n * }}```\n *\n * and then in the component tag\n *\n * ```<z-component style=\"--z-component--background-color: var(${args[\"--z-component--background-color\"]})\" />```\n */\nexport function getColorTokens(): CSSCustomProp[] {\n const tokenGroups = [...Object.values(PALETTES), \"color\"];\n const colorTokens = getRootCssProperties().filter((token): token is CSSCustomProp =>\n tokenGroups.some((group) => token.startsWith(`--${group}`))\n );\n\n return [...new Set(colorTokens)].sort();\n}\n\n/**\n * Get Design System color palettes.\n */\nexport function getPalettes(): Record<keyof typeof PALETTES, CSSCustomProp[]> {\n return Object.values(PALETTES).reduce(\n (acc, paletteName) => {\n const tokens = getRootCssProperties().filter((token): token is CSSCustomProp =>\n token.startsWith(`--${paletteName}`)\n );\n\n return {\n ...acc,\n [paletteName]: tokens.sort((a, b) => +a.replace(/\\D/g, \"\") - +b.replace(/\\D/g, \"\")),\n };\n },\n {} as Record<keyof typeof PALETTES, CSSCustomProp[]>\n );\n}\n\n/**\n * Get Design System color tokens wrapped with CSS `var()`.\n * @example ```\n * argTypes={{\n * \"--z-component--background-color\": {\n * control: {type: \"select\"},\n * options: getColorTokens(),\n * }\n * }}```\n *\n * and then in the component tag\n *\n * ```<z-component style=\"--z-component--background-color: ${args[\"--z-component--background-color\"]}\" />```\n */\nexport function getColorVars(): `var(${CSSCustomProp})`[] {\n return getColorTokens().map((token) => `var(${token})` as const);\n}\n\n/**\n * Get Design System color tokens as readable labels for `control` configuration.\n * It assumes you set the options using the `getColorTokens()` function, so expected options are something like `var(--color-token)`.\n * @example ```\n * argTypes={{\n * \"--z-component--background-color\": {\n * options: getColorTokens(),\n * control: {\n * type: \"select\",\n * labels: getColorVarsLabels(),\n * },\n * }\n * }}```\n */\nexport function getColorVarsLabels(): OptionsConfig[\"labels\"] {\n return getColorVars().reduce(\n (acc, tokenVar) => {\n const tokenLabel = tokenVar.replace(/^var\\(--(.*)\\)/, \"$1\");\n\n return {\n ...acc,\n [tokenVar]: tokenLabel,\n };\n },\n {null: \"default\"}\n );\n}\n\n/**\n * Get Design System themes tokens.\n */\nexport function getThemesColorTokens(): `--color${string}`[] {\n const colorTokens = getRootCssProperties().filter((token): token is `--color${string}` =>\n token.startsWith(\"--color\")\n );\n\n // remove duplicates\n return [...new Set(colorTokens)];\n}\n\n/**\n * Get the value of a token for a given theme.\n * @param themeClass CSS class name of the theme\n * @param token Token name to get the value of\n * @returns The value of the token for the given theme.\n */\nexport function getThemeTokenValue(themeClass: string, token: `--${string}`): string | undefined {\n const themeStyle = Array.from(document.styleSheets)\n .flatMap((sheet) => Array.from(sheet.cssRules))\n .filter((rule): rule is CSSStyleRule => rule instanceof CSSStyleRule)\n .find((rule) => rule.selectorText.includes(themeClass));\n\n const value = themeStyle.styleMap.get(token)?.[0] as CSSStyleValue | undefined;\n\n return value instanceof CSSVariableReferenceValue\n ? getComputedStyle(document.documentElement).getPropertyValue(value.variable)\n : (value?.toString() ?? undefined);\n}\n\n/**\n * Get a Storybook Arg config for Design System color tokens.\n * Useful to configure a control for the stories.\n * @param nullable - If true, it will add a `null` option to the list of options, with a label of \"-\" to allow the user to deselect a color value.\n * @example ```\n * \"--z-component--background-color\": getColorTokenArgConfig()\n * ```\n */\nexport function getColorTokenArgConfig(nullable = false): Args {\n const colorTokens = getColorVars();\n if (nullable) {\n colorTokens.unshift(null);\n }\n\n return {\n options: colorTokens,\n control: {\n type: \"select\",\n labels: getColorVarsLabels(),\n },\n } satisfies Args;\n}\n"]}
|