@aic-kits/react 0.14.4 → 0.15.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.
@@ -1,7 +1,9 @@
1
1
  import { IconWeight } from '@phosphor-icons/react';
2
2
  import { Theme } from '../';
3
- import { BorderWidth, Color, FontSize, FontWeight, Size, Space } from '../common';
3
+ import { BorderWidth, Color, FontSize, FontWeight, Radius, Size, Space } from '../common';
4
4
  export type ButtonSize = 'sm' | 'md' | 'lg';
5
+ export type ButtonVariant = 'solid' | 'outlined' | 'text';
6
+ export type ButtonCorner = 'circle' | 'rounded' | 'square';
5
7
  export interface ButtonSizeConfig {
6
8
  paddingHorizontal: Space;
7
9
  paddingVertical: Space;
@@ -13,18 +15,16 @@ export interface ButtonSizeConfig {
13
15
  }
14
16
  export interface ButtonThemeConfig {
15
17
  squircleBorderRadii: {
16
- circle: string;
17
- rounded: string;
18
- square: string;
18
+ [key in ButtonCorner]: Radius;
19
19
  };
20
20
  loadingConfig: {
21
- size: string;
21
+ size: Size;
22
22
  };
23
23
  defaultColor: Color;
24
24
  defaultTextColor: Color;
25
25
  iconSpacing?: Space;
26
26
  sizes: Record<ButtonSize, ButtonSizeConfig>;
27
- variants?: Record<string, {
27
+ variants?: Record<ButtonVariant, {
28
28
  bgColor?: Color;
29
29
  textColor?: Color;
30
30
  borderColor?: Color;
@@ -10,6 +10,8 @@ import { HeaderThemeConfig } from './header';
10
10
  import { InputThemeConfig } from './input';
11
11
  import { ListThemeConfig } from './list';
12
12
  import { LoadingThemeConfig } from './loading';
13
+ import { PaginationTheme } from './pagination';
14
+ import { ProgressThemeConfig, ProgressSize, ProgressVariant } from './progress';
13
15
  import { SelectThemeConfig, SelectSize, SelectVariant } from './select';
14
16
  import { SkeletonThemeConfig } from './skeleton';
15
17
  import { TagThemeConfig } from './tag';
@@ -24,6 +26,7 @@ export interface ComponentsTheme {
24
26
  input: InputThemeConfig;
25
27
  list: ListThemeConfig;
26
28
  loading: LoadingThemeConfig;
29
+ pagination: PaginationTheme;
27
30
  skeleton: SkeletonThemeConfig;
28
31
  touchable: TouchableThemeConfig;
29
32
  vimeo: VimeoThemeConfig;
@@ -32,6 +35,7 @@ export interface ComponentsTheme {
32
35
  tag: TagThemeConfig;
33
36
  checkbox: CheckboxThemeConfig;
34
37
  select: SelectThemeConfig;
38
+ progress: ProgressThemeConfig;
35
39
  }
36
40
  export declare const getComponentsTheme: (theme: Theme) => ComponentsTheme;
37
41
  export * from './art';
@@ -42,6 +46,7 @@ export * from './header';
42
46
  export * from './input';
43
47
  export * from './list';
44
48
  export * from './loading';
49
+ export * from './pagination';
45
50
  export * from './skeleton';
46
51
  export * from './touchable';
47
52
  export * from './vimeo';
@@ -50,4 +55,5 @@ export * from './accordion';
50
55
  export * from './tag';
51
56
  export * from './checkbox';
52
57
  export * from './select';
53
- export type { SelectSize, SelectVariant };
58
+ export * from './progress';
59
+ export type { SelectSize, SelectVariant, ProgressSize, ProgressVariant };
@@ -0,0 +1,48 @@
1
+ import { IconWeight } from '@phosphor-icons/react';
2
+ import { Color, FontSize, Radius, Size, Space } from '../common';
3
+ import { ButtonSize } from '../components';
4
+ import { Theme } from '../getTheme';
5
+ export type PaginationSize = 'small' | 'medium' | 'large';
6
+ export type PaginationShape = 'circular' | 'rounded';
7
+ export interface PaginationContainerSizeTheme {
8
+ gap: Space;
9
+ }
10
+ export interface PaginationItemShapeTheme {
11
+ container: {
12
+ borderRadius: Radius;
13
+ };
14
+ }
15
+ export interface PaginationItemSizeTheme {
16
+ container: {
17
+ size: Size;
18
+ };
19
+ text: {
20
+ fontSize: FontSize;
21
+ };
22
+ icon: {
23
+ size: Size;
24
+ weight: IconWeight;
25
+ };
26
+ buttonSize: ButtonSize;
27
+ }
28
+ export interface PaginationTheme {
29
+ container: {
30
+ sizes: {
31
+ [key in PaginationSize]: PaginationContainerSizeTheme;
32
+ };
33
+ };
34
+ item: {
35
+ defaultColor: Color;
36
+ text: {
37
+ color: Color;
38
+ disabledColor: Color;
39
+ };
40
+ shapes: {
41
+ [key in PaginationShape]: PaginationItemShapeTheme;
42
+ };
43
+ sizes: {
44
+ [key in PaginationSize]: PaginationItemSizeTheme;
45
+ };
46
+ };
47
+ }
48
+ export declare const getPaginationTheme: (_theme: Theme) => PaginationTheme;
@@ -0,0 +1,21 @@
1
+ import { Theme } from '../';
2
+ import { Color, BorderWidth, Radius, Size } from '../common';
3
+ export type ProgressVariant = 'soft' | 'outlined' | 'plain';
4
+ export type ProgressSize = 'sm' | 'md' | 'lg';
5
+ export interface ProgressSizeConfig {
6
+ height: Size;
7
+ borderRadius: Radius;
8
+ }
9
+ export interface ProgressVariantConfig {
10
+ containerBackgroundColor: Color | string;
11
+ containerBorderColor?: Color | string;
12
+ containerBorderWidth?: BorderWidth;
13
+ defaultProgressColor: Color;
14
+ }
15
+ export interface ProgressThemeConfig {
16
+ defaultVariant: ProgressVariant;
17
+ defaultSize: ProgressSize;
18
+ sizes: Record<ProgressSize, ProgressSizeConfig>;
19
+ variants: Record<ProgressVariant, ProgressVariantConfig>;
20
+ }
21
+ export declare const progressTheme: (_theme: Theme) => ProgressThemeConfig;
@@ -1 +1,2 @@
1
1
  export * from './ssr';
2
+ export * from './responsiveness';
@@ -0,0 +1,79 @@
1
+ /**
2
+ * The breakpoints used in the responsive system.
3
+ * @public
4
+ */
5
+ export type ResponsiveKey = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ /**
7
+ * The breakpoints used in the responsive system.
8
+ * @public
9
+ */
10
+ export declare const RESPONSIVE_BREAKPOINTS: Record<ResponsiveKey, number>;
11
+ /**
12
+ * The breakpoints used in the responsive system.
13
+ * @public
14
+ */
15
+ export declare const RESPONSIVE_BREAKPOINT_KEYS: ResponsiveKey[];
16
+ /**
17
+ * A responsive prop is a value that can be a single value or a partial record of values for each breakpoint.
18
+ * @public
19
+ */
20
+ export type ResponsiveValue<T> = Omit<Partial<Record<ResponsiveKey, T>>, 'xs'> & {
21
+ xs: T;
22
+ } | Omit<Partial<Record<ResponsiveKey, T>>, 'sm'> & {
23
+ sm: T;
24
+ } | Omit<Partial<Record<ResponsiveKey, T>>, 'md'> & {
25
+ md: T;
26
+ } | Omit<Partial<Record<ResponsiveKey, T>>, 'lg'> & {
27
+ lg: T;
28
+ } | Omit<Partial<Record<ResponsiveKey, T>>, 'xl'> & {
29
+ xl: T;
30
+ };
31
+ /**
32
+ * A value that can be a single value or a partial record of values for each breakpoint.
33
+ * @public
34
+ */
35
+ export type WithResponsiveValue<T> = T | ResponsiveValue<T>;
36
+ /**
37
+ * A higher-order type that converts a record of values to a record of responsive values.
38
+ * @public
39
+ */
40
+ export type WithResponsive<T extends object> = {
41
+ [K in keyof T]: WithResponsiveValue<T[K]>;
42
+ };
43
+ /**
44
+ * Checks if a value is a responsive prop.
45
+ * @public
46
+ * @param value - The value to check.
47
+ * @returns True if the value is a responsive prop, false otherwise.
48
+ */
49
+ export declare const isResponsiveValue: <T>(value: WithResponsiveValue<T>) => value is ResponsiveValue<T>;
50
+ /**
51
+ * Transforms a responsive value.
52
+ * @public
53
+ * @param value - The value to transform.
54
+ * @param transform - The transform function.
55
+ * @returns The transformed value.
56
+ */
57
+ export declare const transformResponsiveValue: <SourceType, TargetType>(value: WithResponsiveValue<SourceType>, transform: (value: SourceType) => TargetType) => WithResponsiveValue<TargetType>;
58
+ /**
59
+ * Gets the responsive value for a given breakpoint.
60
+ * @public
61
+ * @param value - The value to get the responsive value for.
62
+ * @param breakpoint - The breakpoint to get the responsive value for.
63
+ * @returns The responsive value for the given breakpoint.
64
+ */
65
+ export declare const getResponsiveValue: <T>(value: WithResponsiveValue<T>, breakpoint: ResponsiveKey) => T;
66
+ /**
67
+ * Populates a responsive value with all breakpoints.
68
+ * @public
69
+ * @param responsiveValue - The responsive value to populate.
70
+ * @returns The populated responsive value.
71
+ */
72
+ export declare const populateResponsiveValue: <T extends object>(responsiveValue: WithResponsiveValue<T>) => Record<ResponsiveKey, T>;
73
+ /**
74
+ * Generates responsive styles for a given object.
75
+ * @public
76
+ * @param styles - The styles to generate responsive styles for.
77
+ * @returns The generated responsive styles.
78
+ */
79
+ export declare const generateResponsiveStyles: <T extends object>(styles: WithResponsive<T>) => import('styled-components').RuleSet<object>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aic-kits/react",
3
- "version": "0.14.4",
3
+ "version": "0.15.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -46,5 +46,5 @@
46
46
  "vite-plugin-dts": "^4.3.0",
47
47
  "vitest": "^2.1.8"
48
48
  },
49
- "gitHead": "6ad1c750aa410f95ee70cac6f37807e10651310c"
49
+ "gitHead": "115df4862e02fda15d29b9904378d60bfd690752"
50
50
  }