@kalink-ui/seedly 0.4.0 → 0.6.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/CHANGELOG.md +12 -0
- package/package.json +25 -14
- package/src/components/box/box.css.ts +36 -15
- package/src/components/box/box.tsx +2 -2
- package/src/components/button/button.css.ts +1 -1
- package/src/components/button/button.tsx +6 -8
- package/src/components/center/center.css.ts +28 -11
- package/src/components/center/center.tsx +1 -2
- package/src/components/cluster/cluster.css.ts +71 -18
- package/src/components/cluster/cluster.tsx +1 -2
- package/src/components/cover/cover.css.ts +44 -15
- package/src/components/cover/cover.tsx +1 -2
- package/src/components/frame/frame.css.ts +54 -20
- package/src/components/frame/frame.tsx +1 -2
- package/src/components/grid/grid.css.ts +16 -7
- package/src/components/grid/grid.tsx +1 -2
- package/src/components/sidebar/sidebar.css.ts +45 -16
- package/src/components/sidebar/sidebar.tsx +1 -2
- package/src/components/stack/stack.css.ts +21 -8
- package/src/components/stack/stack.tsx +1 -2
- package/src/components/switcher/switcher.css.ts +47 -14
- package/src/components/switcher/switcher.tsx +1 -2
- package/src/components/text/index.ts +1 -0
- package/src/components/text/text.css.ts +15 -0
- package/src/components/text/text.tsx +43 -0
- package/src/styles/layers.css.ts +6 -0
- package/src/styles/reset.css.ts +116 -0
- package/src/styles/seed/seed.tsx +4 -4
- package/src/styles/system-contract.css.ts +2 -2
- package/src/styles/typography.css.ts +23 -0
- package/src/utils/extract-sprinkles-props.ts +1 -0
- package/src/utils/index.ts +0 -1
- package/src/types/index.ts +0 -5
- package/src/types/utils.types.ts +0 -15
- package/src/utils/is-object.ts +0 -3
package/src/styles/seed/seed.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { clsx } from 'clsx';
|
|
2
2
|
|
|
3
|
-
import type { PolymorphicComponentProps } from '@/types/utils.types';
|
|
4
3
|
import {
|
|
5
4
|
extractSprinklesProps,
|
|
6
5
|
type GetSprinkles,
|
|
7
6
|
type SprinklesFnBase,
|
|
8
|
-
} from '
|
|
7
|
+
} from '../../utils/extract-sprinkles-props';
|
|
9
8
|
|
|
9
|
+
import type { PolymorphicComponentProps } from '@kalink-ui/dibbly/types';
|
|
10
10
|
import type { ElementType } from 'react';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -22,10 +22,10 @@ export type SeedProps<
|
|
|
22
22
|
TSprinklesFn extends SprinklesFnBase,
|
|
23
23
|
> = PolymorphicComponentProps<TUse> & GetSprinkles<TSprinklesFn>;
|
|
24
24
|
|
|
25
|
-
export
|
|
25
|
+
export type CreateSeedParams<SprinklesFn> = {
|
|
26
26
|
sprinkles: SprinklesFn;
|
|
27
27
|
defaultClassName?: string;
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
|
|
30
30
|
export function plantSeed<SprinklesFn extends SprinklesFnBase>({
|
|
31
31
|
sprinkles,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { createThemeContract } from '@vanilla-extract/css';
|
|
2
2
|
|
|
3
|
-
const typeContract = {
|
|
3
|
+
export const typeContract = {
|
|
4
4
|
font: null,
|
|
5
5
|
weight: null,
|
|
6
6
|
lineHeight: null,
|
|
7
7
|
tracking: null,
|
|
8
8
|
size: null,
|
|
9
|
-
};
|
|
9
|
+
} as const;
|
|
10
10
|
|
|
11
11
|
export const sys = createThemeContract({
|
|
12
12
|
layout: {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { styleVariants } from '@vanilla-extract/css';
|
|
2
|
+
|
|
3
|
+
import { sys } from './system-contract.css';
|
|
4
|
+
|
|
5
|
+
type TypographySize = 'large' | 'medium' | 'small';
|
|
6
|
+
|
|
7
|
+
export const typography = Object.entries(sys.typography).reduce(
|
|
8
|
+
(acc, [key, value]) => {
|
|
9
|
+
return {
|
|
10
|
+
...acc,
|
|
11
|
+
[key]: styleVariants(value, (variant) => {
|
|
12
|
+
return {
|
|
13
|
+
fontFamily: variant.font,
|
|
14
|
+
fontWeight: variant.weight,
|
|
15
|
+
lineHeight: variant.lineHeight,
|
|
16
|
+
letterSpacing: variant.tracking,
|
|
17
|
+
fontSize: variant.size,
|
|
18
|
+
};
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
},
|
|
22
|
+
{} as Record<keyof typeof sys.typography, Record<TypographySize, string>>,
|
|
23
|
+
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { SprinklesProperties } from '@vanilla-extract/sprinkles';
|
|
2
2
|
import type { UnknownRecord } from 'type-fest';
|
|
3
3
|
|
|
4
|
+
/* eslint-disable-next-line @typescript-eslint/consistent-type-definitions */
|
|
4
5
|
export interface SprinklesFnBase {
|
|
5
6
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
6
7
|
(...args: any): string;
|
package/src/utils/index.ts
CHANGED
package/src/types/index.ts
DELETED
package/src/types/utils.types.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef, ElementType } from 'react';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
4
|
-
export type DistributiveOmit<T, TOmitted extends PropertyKey> = T extends any
|
|
5
|
-
? Omit<T, TOmitted>
|
|
6
|
-
: never;
|
|
7
|
-
|
|
8
|
-
export type UnwrapArray<R> = R extends unknown[] ? UnwrapArray<R[number]> : R;
|
|
9
|
-
|
|
10
|
-
export type PolymorphicComponentProps<TUse extends ElementType> = {
|
|
11
|
-
use?: TUse;
|
|
12
|
-
} & DistributiveOmit<
|
|
13
|
-
ComponentPropsWithRef<ElementType extends TUse ? 'div' : TUse>,
|
|
14
|
-
'use'
|
|
15
|
-
>;
|
package/src/utils/is-object.ts
DELETED