@keboola/design 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -51,33 +51,6 @@ For more information, read [Vitest's documentation](https://vitest.dev/guide/)
51
51
 
52
52
  ### Icons
53
53
 
54
- All icons should use `Icon` component, which is a wrapper around `FontAwesomeIcon`. Available icons are defined in FontAwesome kit.
54
+ All icons should use the `Icon` component, which is a wrapper around `FontAwesomeIcon`. Browse the available icons in the Storybook `Icons` page.
55
55
 
56
- #### Managing FontAwesome icons
57
-
58
- First, go to [FontAwesome kit](https://fontawesome.com/kits/be8bcf7e5e/icons) and log in via [credentials from 1Password](https://start.1password.com/open/i?a=Z6RK6YPRYZESDHSAB2SWYZSSUM&v=3eqzewv3lbgwupxpmehccbswgq&i=6xk57yia2evbo63mdrtkwtluky&h=keboola.1password.com).
59
-
60
- **Adding existing FontAwesome icons:**
61
-
62
- - In <b>Pro Styles</b> you pick one style (e.g. <b>Solid</b>), search icon name and click on it
63
- - After you selected all new icons, click on <b>Save Subset</b>
64
-
65
- **Adding custom icons:**
66
-
67
- - Click on <b>Upload Icons</b> tab
68
- - Upload your custom SVG icon(s). Make sure the SVG follows FontAwesome's requirements:
69
- - Single color (black fills, no strokes)
70
- - Square viewBox (e.g., `0 0 512 512`)
71
- - Clean, optimized SVG code
72
- - Give your icon a meaningful name (use kebab-case)
73
- - Click <b>Upload</b> and then <b>Save Subset</b>
74
-
75
- **Finalizing changes:**
76
-
77
- - Update the kit NPM package by running:
78
-
79
- ```shell
80
- yarn workspace @keboola/design up @awesome.me/kit-be8bcf7e5e
81
- ```
82
-
83
- **Note:** When using custom icons in code, you must use the `fak` prefix (e.g., `<Icon icon={['fak', 'custom-icon']} />`)
56
+ When using custom icons (prefix `fak`), pass the icon as a tuple: `<Icon icon={['fak', 'custom-icon']} />`.
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ var icons = require('@awesome.me/kit-be8bcf7e5e/icons');
4
+
5
+ // src/icon-names.ts
6
+ var getAvailableIconNames = () => {
7
+ const names = /* @__PURE__ */ new Set();
8
+ for (const def of Object.values(icons.fas)) {
9
+ if (def !== null && typeof def === "object" && "iconName" in def && typeof def.iconName === "string") {
10
+ names.add(def.iconName);
11
+ }
12
+ }
13
+ return [...names].sort();
14
+ };
15
+
16
+ exports.getAvailableIconNames = getAvailableIconNames;
17
+ //# sourceMappingURL=icon-names.cjs.map
18
+ //# sourceMappingURL=icon-names.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/icon-names.ts"],"names":["fas"],"mappings":";;;;;AAMO,IAAM,wBAAwB,MAAgB;AACnD,EAAA,MAAM,KAAA,uBAAY,GAAA,EAAY;AAC9B,EAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,MAAA,CAAOA,SAAG,CAAA,EAAG;AACpC,IAAA,IACE,GAAA,KAAQ,IAAA,IACR,OAAO,GAAA,KAAQ,QAAA,IACf,cAAc,GAAA,IACd,OAAO,GAAA,CAAI,QAAA,KAAa,QAAA,EACxB;AACA,MAAA,KAAA,CAAM,GAAA,CAAI,IAAI,QAAQ,CAAA;AAAA,IACxB;AAAA,EACF;AACA,EAAA,OAAO,CAAC,GAAG,KAAK,CAAA,CAAE,IAAA,EAAK;AACzB","file":"icon-names.cjs","sourcesContent":["import { fas } from '@awesome.me/kit-be8bcf7e5e/icons';\n\n/**\n * Reads available FontAwesome solid icon names from the FA kit.\n * Returns deduplicated, sorted kebab-case icon names (e.g. \"chart-bar\", \"circle-check\").\n */\nexport const getAvailableIconNames = (): string[] => {\n const names = new Set<string>();\n for (const def of Object.values(fas)) {\n if (\n def !== null &&\n typeof def === 'object' &&\n 'iconName' in def &&\n typeof def.iconName === 'string'\n ) {\n names.add(def.iconName);\n }\n }\n return [...names].sort();\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import { fas } from '@awesome.me/kit-be8bcf7e5e/icons';
2
+
3
+ // src/icon-names.ts
4
+ var getAvailableIconNames = () => {
5
+ const names = /* @__PURE__ */ new Set();
6
+ for (const def of Object.values(fas)) {
7
+ if (def !== null && typeof def === "object" && "iconName" in def && typeof def.iconName === "string") {
8
+ names.add(def.iconName);
9
+ }
10
+ }
11
+ return [...names].sort();
12
+ };
13
+
14
+ export { getAvailableIconNames };
15
+ //# sourceMappingURL=icon-names.js.map
16
+ //# sourceMappingURL=icon-names.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/icon-names.ts"],"names":[],"mappings":";;;AAMO,IAAM,wBAAwB,MAAgB;AACnD,EAAA,MAAM,KAAA,uBAAY,GAAA,EAAY;AAC9B,EAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,MAAA,CAAO,GAAG,CAAA,EAAG;AACpC,IAAA,IACE,GAAA,KAAQ,IAAA,IACR,OAAO,GAAA,KAAQ,QAAA,IACf,cAAc,GAAA,IACd,OAAO,GAAA,CAAI,QAAA,KAAa,QAAA,EACxB;AACA,MAAA,KAAA,CAAM,GAAA,CAAI,IAAI,QAAQ,CAAA;AAAA,IACxB;AAAA,EACF;AACA,EAAA,OAAO,CAAC,GAAG,KAAK,CAAA,CAAE,IAAA,EAAK;AACzB","file":"icon-names.js","sourcesContent":["import { fas } from '@awesome.me/kit-be8bcf7e5e/icons';\n\n/**\n * Reads available FontAwesome solid icon names from the FA kit.\n * Returns deduplicated, sorted kebab-case icon names (e.g. \"chart-bar\", \"circle-check\").\n */\nexport const getAvailableIconNames = (): string[] => {\n const names = new Set<string>();\n for (const def of Object.values(fas)) {\n if (\n def !== null &&\n typeof def === 'object' &&\n 'iconName' in def &&\n typeof def.iconName === 'string'\n ) {\n names.add(def.iconName);\n }\n }\n return [...names].sort();\n};\n"]}