@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.
Files changed (35) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +25 -14
  3. package/src/components/box/box.css.ts +36 -15
  4. package/src/components/box/box.tsx +2 -2
  5. package/src/components/button/button.css.ts +1 -1
  6. package/src/components/button/button.tsx +6 -8
  7. package/src/components/center/center.css.ts +28 -11
  8. package/src/components/center/center.tsx +1 -2
  9. package/src/components/cluster/cluster.css.ts +71 -18
  10. package/src/components/cluster/cluster.tsx +1 -2
  11. package/src/components/cover/cover.css.ts +44 -15
  12. package/src/components/cover/cover.tsx +1 -2
  13. package/src/components/frame/frame.css.ts +54 -20
  14. package/src/components/frame/frame.tsx +1 -2
  15. package/src/components/grid/grid.css.ts +16 -7
  16. package/src/components/grid/grid.tsx +1 -2
  17. package/src/components/sidebar/sidebar.css.ts +45 -16
  18. package/src/components/sidebar/sidebar.tsx +1 -2
  19. package/src/components/stack/stack.css.ts +21 -8
  20. package/src/components/stack/stack.tsx +1 -2
  21. package/src/components/switcher/switcher.css.ts +47 -14
  22. package/src/components/switcher/switcher.tsx +1 -2
  23. package/src/components/text/index.ts +1 -0
  24. package/src/components/text/text.css.ts +15 -0
  25. package/src/components/text/text.tsx +43 -0
  26. package/src/styles/layers.css.ts +6 -0
  27. package/src/styles/reset.css.ts +116 -0
  28. package/src/styles/seed/seed.tsx +4 -4
  29. package/src/styles/system-contract.css.ts +2 -2
  30. package/src/styles/typography.css.ts +23 -0
  31. package/src/utils/extract-sprinkles-props.ts +1 -0
  32. package/src/utils/index.ts +0 -1
  33. package/src/types/index.ts +0 -5
  34. package/src/types/utils.types.ts +0 -15
  35. package/src/utils/is-object.ts +0 -3
@@ -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 '@/utils/extract-sprinkles-props';
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 interface CreateSeedParams<SprinklesFn> {
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;
@@ -1,3 +1,2 @@
1
1
  export { extractSprinklesProps } from './extract-sprinkles-props';
2
- export { isObject } from './is-object';
3
2
  export { mapContractVars } from './map-contract-vars';
@@ -1,5 +0,0 @@
1
- export {
2
- type PolymorphicComponentProps,
3
- type DistributiveOmit,
4
- type UnwrapArray,
5
- } from './utils.types';
@@ -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
- >;
@@ -1,3 +0,0 @@
1
- export const isObject = <T extends object>(value: unknown): value is T => {
2
- return !!value && typeof value === "object" && !Array.isArray(value);
3
- };