@kalink-ui/seedly 0.8.0 → 0.8.1

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @kalink-ui/seedly
2
2
 
3
+ ## 0.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 6670251: Do not ignore arg-types files from npm package
8
+
3
9
  ## 0.8.0
4
10
 
5
11
  ### Minor Changes
@@ -0,0 +1,67 @@
1
+
2
+ > @kalink-ui/seedly@0.8.0 build-storybook /Users/louis/dev/kalink-ui/packages/seedly
3
+ > storybook build --output-dir\=/tmp/chromatic--31226-9S6bTYf09Tsv --webpack-stats-json\=/tmp/chromatic--31226-9S6bTYf09Tsv
4
+
5
+ @storybook/core v8.6.4
6
+ 
7
+ info => Cleaning outputDir: ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv
8
+ info => Loading presets
9
+ info => Building manager..
10
+ info => Manager built (106 ms)
11
+ info => Building preview..
12
+ vite v6.2.1 building for production...
13
+ transforming...
14
+ ✓ 172 modules transformed.
15
+ rendering chunks...
16
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/iframe.html  17.54 kB
17
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/layers.css.ts-C66eHa0l.css  0.07 kB
18
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/text-or75WcbY.css  0.11 kB
19
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/frame-wUsZLpNa.css  0.38 kB
20
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/grid-svOAN5eX.css  0.84 kB
21
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/seed-BSZyHzsv.css  0.86 kB
22
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/stack-fHq0j-Mf.css  0.94 kB
23
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/sidebar-BfSQAuXb.css  0.95 kB
24
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/center-DXS2n_JN.css  1.03 kB
25
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/cover-ClXyrnXr.css  1.03 kB
26
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/cluster-BYRTQ7OR.css  1.04 kB
27
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/switcher-CaEmo08Z.css  1.15 kB
28
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/box-C2bbsHZY.css  1.38 kB
29
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/typography.css.ts-SSimWp8t.css  2.25 kB
30
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/button-Bz5cKKrj.css  2.70 kB
31
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-CT6mYyLc.js  0.16 kB
32
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-BtThajRf.js  0.17 kB
33
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-DoMOH9fu.js  0.23 kB
34
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/vanilla-extract-dynamic.esm-BUlnp6I2.js  0.31 kB
35
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-caVMbCIR.js  0.69 kB
36
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/typography.css-DQ-nfkim.js  0.75 kB
37
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/index-ogSvIofg.js  0.77 kB
38
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/stack-CyXomRKS.js  0.78 kB
39
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/cluster.stories-CPq7agrP.js  0.82 kB
40
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/cluster-Dy3GR3gU.js  0.94 kB
41
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/frame.stories-5pt_eAa4.js  0.98 kB
42
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/clsx-yWx7DIeZ.js  1.09 kB
43
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/common-args-BxOi7vI0.js  1.16 kB
44
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/heading.stories-DnTp5v4g.js  1.18 kB
45
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/center.stories-DVx4loHB.js  1.24 kB
46
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/box.stories-D4I0_iYq.js  1.31 kB
47
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/text.stories-B94F4zrO.js  1.38 kB
48
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/cover.stories-D5Tpwx4p.js  1.44 kB
49
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/switcher.stories-vZpJAqZC.js  1.62 kB
50
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/grid.stories-Cg2miXZJ.js  1.66 kB
51
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/sidebar.stories-BsY8S9Y-.js  1.87 kB
52
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/createRuntimeFn-62c9670f.esm-BmIeg6ni.js  2.04 kB
53
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/stack.stories-B3r3rUis.js  2.14 kB
54
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-A6H2BGQG.js  3.40 kB
55
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-xOAuwTm5.js  4.87 kB
56
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/seed.stories-OnvavYFI.js  5.10 kB
57
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-DY_pW_WS.js  7.62 kB
58
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/button.stories-CoUSjtPq.js  7.87 kB
59
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/preview-CuLlOZat.js  8.08 kB
60
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/entry-preview-B0dZ39Bz.js  38.10 kB
61
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/react-18-Uoay0tNS.js 177.34 kB
62
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/iframe-2U23pR0X.js 210.78 kB
63
+ ../../../../../../tmp/chromatic--31226-9S6bTYf09Tsv/assets/index-0CFqCGht.js 658.80 kB
64
+ ✓ built in 1.79s
65
+ info => Preview built (2.14 s)
66
+ info => preview stats written to /tmp/chromatic--31226-9S6bTYf09Tsv/preview-stats.json
67
+ info => Output directory: /tmp/chromatic--31226-9S6bTYf09Tsv
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kalink-ui/seedly",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "A set of components for building UIs with React and TypeScript",
5
5
  "sideEffects": false,
6
6
  "license": "MIT",
@@ -46,9 +46,9 @@
46
46
  "vite": "^6.2.1",
47
47
  "vite-tsconfig-paths": "^5.1.4",
48
48
  "vitest": "^3.0.8",
49
- "@kalink-ui/dibbly": "0.2.0",
49
+ "@kalink-ui/typescript-config": "0.4.0",
50
50
  "@kalink-ui/eslint-config": "0.7.0",
51
- "@kalink-ui/typescript-config": "0.4.0"
51
+ "@kalink-ui/dibbly": "0.2.0"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "@vanilla-extract/css": "^1.17.1",
@@ -0,0 +1,36 @@
1
+ import { type ComplexStyleRule } from '@vanilla-extract/css';
2
+ import { type RuntimeFn } from '@vanilla-extract/recipes';
3
+
4
+ type RecipeStyleRule = ComplexStyleRule | string;
5
+ type VariantDefinitions = Record<string, RecipeStyleRule>;
6
+ type VariantGroups = Record<string, VariantDefinitions>;
7
+
8
+ export function argTypesFromRecipe(
9
+ recipe: RuntimeFn<VariantGroups>,
10
+ excludes: string[] = [],
11
+ ) {
12
+ return Object.entries(recipe.classNames.variants).reduce(
13
+ (acc, [name, variant]) => {
14
+ if (excludes.includes(name)) {
15
+ return acc;
16
+ }
17
+
18
+ const options = Object.keys(variant);
19
+ let control = options.length > 5 ? 'select' : 'radio';
20
+
21
+ if (options.length === 1 && options[0] === 'true') {
22
+ options.push('false');
23
+ control = 'boolean';
24
+ }
25
+
26
+ return {
27
+ ...acc,
28
+ [name]: {
29
+ control,
30
+ options,
31
+ },
32
+ };
33
+ },
34
+ {},
35
+ );
36
+ }
@@ -0,0 +1,43 @@
1
+ import { isObject } from '@kalink-ui/dibbly';
2
+
3
+ type ArgTypesFromSprinklesProps = {
4
+ /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
5
+ props: Record<string, any>;
6
+ excludes?: string[];
7
+ category?: string;
8
+ } & {};
9
+
10
+ export function argTypesFromSprinkles({
11
+ props,
12
+ excludes = [],
13
+ category = 'Sprinkles props',
14
+ }: ArgTypesFromSprinklesProps) {
15
+ return Object.entries(props).reduce((acc, [name]) => {
16
+ if (Array.isArray(excludes) && excludes.includes(name)) {
17
+ return acc;
18
+ }
19
+
20
+ let options = props[name] || [];
21
+ let control = 'select';
22
+
23
+ if (options.length === 1 && options[0] === 'true') {
24
+ options.push('false');
25
+ control = 'boolean';
26
+ }
27
+
28
+ if (isObject(options)) {
29
+ options = Object.fromEntries(
30
+ Object.keys(options).map((key) => [key, key]),
31
+ );
32
+ }
33
+
34
+ return {
35
+ ...acc,
36
+ [name]: {
37
+ control,
38
+ options,
39
+ table: { category },
40
+ },
41
+ };
42
+ }, {});
43
+ }
@@ -0,0 +1,13 @@
1
+ export const composable = {
2
+ children: {
3
+ control: false,
4
+ description: 'Content of the component.',
5
+ defaultValue: '',
6
+ table: {
7
+ category: 'Intrinsic props',
8
+ type: {
9
+ summary: 'ReactNode',
10
+ },
11
+ },
12
+ },
13
+ };
@@ -0,0 +1,4 @@
1
+ export { composable } from './composable';
2
+ export { polymorphic } from './polymorphic';
3
+ export { referable } from './referable';
4
+ export { stylable } from './stylable';
@@ -0,0 +1,14 @@
1
+ export const polymorphic = {
2
+ use: {
3
+ control: false,
4
+ description:
5
+ 'The component used to render the root node of the component. Either a string to use an `JSX.IntrinsicElements` or a component reference to use a `React.ComponentType`',
6
+ defaultValue: '',
7
+ table: {
8
+ category: 'Intrinsic props',
9
+ type: {
10
+ summary: 'ElementType',
11
+ },
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,10 @@
1
+ export const referable = {
2
+ ref: {
3
+ control: false,
4
+ description: 'Ref passed to the component root.',
5
+ defaultValue: '',
6
+ table: {
7
+ category: 'Intrinsic props',
8
+ },
9
+ },
10
+ };
@@ -0,0 +1,14 @@
1
+ export const stylable = {
2
+ className: {
3
+ control: false,
4
+ description:
5
+ 'A class name string passed to the component. Merged with the inner class names.',
6
+ defaultValue: '',
7
+ table: {
8
+ category: 'Intrinsic props',
9
+ type: {
10
+ summary: 'string',
11
+ },
12
+ },
13
+ },
14
+ };
@@ -0,0 +1,26 @@
1
+ /* eslint-disable import/namespace */
2
+ import * as CommonArgDefs from './common';
3
+
4
+ export enum CommonArgs {
5
+ COMPOSABLE = 'composable',
6
+ POLYMORPHIC = 'polymorphic',
7
+ STYLABLE = 'stylable',
8
+ REFERABLE = 'referable',
9
+ }
10
+
11
+ export function commonArgs(args: CommonArgs[]) {
12
+ const argTypes: Partial<Record<string, object>> = {};
13
+ const knownArgs = Object.values(CommonArgs);
14
+
15
+ for (const arg of args) {
16
+ if (!knownArgs.includes(arg)) {
17
+ continue;
18
+ }
19
+
20
+ for (const argDef in CommonArgDefs[arg]) {
21
+ argTypes[argDef] = (CommonArgDefs[arg] as Record<string, object>)[argDef];
22
+ }
23
+ }
24
+
25
+ return argTypes;
26
+ }
@@ -0,0 +1,3 @@
1
+ export { argTypesFromRecipe } from './arg-types-from-recipe';
2
+ export { argTypesFromSprinkles } from './arg-types-from-sprinkles';
3
+ export { commonArgs, CommonArgs } from './common-args';