@helpdice/theme 1.1.1 → 1.1.3

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 (109) hide show
  1. package/package.json +88 -7
  2. package/esm/css-baseline/css-baseline.d.ts +0 -10
  3. package/esm/css-baseline/index.d.ts +0 -1
  4. package/esm/index.d.ts +0 -25
  5. package/esm/shared/backdrop.d.ts +0 -14
  6. package/esm/shared/css-transition.d.ts +0 -13
  7. package/esm/shared/dropdown.d.ts +0 -9
  8. package/esm/shared/ellipsis.d.ts +0 -6
  9. package/esm/shared/expand.d.ts +0 -7
  10. package/esm/shared/highlight.d.ts +0 -13
  11. package/esm/subscription/SubscriptionContext.d.ts +0 -14
  12. package/esm/subscription/SubscriptionError.d.ts +0 -5
  13. package/esm/subscription/UpgradeNotice.d.ts +0 -3
  14. package/esm/subscription/index.d.ts +0 -3
  15. package/esm/subscription/withSubscription.d.ts +0 -2
  16. package/esm/themes/index.d.ts +0 -4
  17. package/esm/themes/presets/dark.d.ts +0 -8
  18. package/esm/themes/presets/default.d.ts +0 -8
  19. package/esm/themes/presets/index.d.ts +0 -99
  20. package/esm/themes/presets/shared.d.ts +0 -4
  21. package/esm/themes/shadows.d.ts +0 -82
  22. package/esm/themes/themes.d.ts +0 -18
  23. package/esm/ui-provider/index.d.ts +0 -3
  24. package/esm/ui-provider/theme-provider.d.ts +0 -8
  25. package/esm/ui-provider/ui-provider.d.ts +0 -8
  26. package/esm/use-all-themes/all-themes-context.d.ts +0 -7
  27. package/esm/use-all-themes/index.d.ts +0 -3
  28. package/esm/use-classes/index.d.ts +0 -2
  29. package/esm/use-classes/use-classes.d.ts +0 -4
  30. package/esm/use-current-state/index.d.ts +0 -2
  31. package/esm/use-current-state/use-current-state.d.ts +0 -4
  32. package/esm/use-media-query/index.d.ts +0 -3
  33. package/esm/use-media-query/use-media-query.d.ts +0 -12
  34. package/esm/use-theme/index.d.ts +0 -2
  35. package/esm/use-theme/theme-context.d.ts +0 -4
  36. package/esm/use-toasts/helpers.d.ts +0 -18
  37. package/esm/use-toasts/index.d.ts +0 -3
  38. package/esm/use-toasts/toast-container.d.ts +0 -3
  39. package/esm/use-toasts/toast-item.d.ts +0 -8
  40. package/esm/use-toasts/use-toast.d.ts +0 -40
  41. package/esm/utils/collections.d.ts +0 -15
  42. package/esm/utils/color.d.ts +0 -2
  43. package/esm/utils/layouts.d.ts +0 -20
  44. package/esm/utils/prop-types.d.ts +0 -19
  45. package/esm/utils/types.d.ts +0 -3
  46. package/esm/utils/use-click-anywhere.d.ts +0 -2
  47. package/esm/utils/use-current-state.d.ts +0 -2
  48. package/esm/utils/use-dom-observer.d.ts +0 -3
  49. package/esm/utils/use-hd-ui-context.d.ts +0 -16
  50. package/esm/utils/use-portal.d.ts +0 -2
  51. package/esm/utils/use-previous.d.ts +0 -2
  52. package/esm/utils/use-real-shape.d.ts +0 -9
  53. package/esm/utils/use-resize.d.ts +0 -2
  54. package/esm/utils/use-ssr.d.ts +0 -6
  55. package/esm/utils/use-warning.d.ts +0 -2
  56. /package/{dist → types}/css-baseline/css-baseline.d.ts +0 -0
  57. /package/{dist → types}/css-baseline/index.d.ts +0 -0
  58. /package/{dist → types}/index.d.ts +0 -0
  59. /package/{dist → types}/shared/backdrop.d.ts +0 -0
  60. /package/{dist → types}/shared/css-transition.d.ts +0 -0
  61. /package/{dist → types}/shared/dropdown.d.ts +0 -0
  62. /package/{dist → types}/shared/ellipsis.d.ts +0 -0
  63. /package/{dist → types}/shared/expand.d.ts +0 -0
  64. /package/{dist → types}/shared/highlight.d.ts +0 -0
  65. /package/{dist → types}/subscription/SubscriptionContext.d.ts +0 -0
  66. /package/{dist → types}/subscription/SubscriptionError.d.ts +0 -0
  67. /package/{dist → types}/subscription/UpgradeNotice.d.ts +0 -0
  68. /package/{dist → types}/subscription/index.d.ts +0 -0
  69. /package/{dist → types}/subscription/withSubscription.d.ts +0 -0
  70. /package/{dist → types}/themes/index.d.ts +0 -0
  71. /package/{dist → types}/themes/presets/dark.d.ts +0 -0
  72. /package/{dist → types}/themes/presets/default.d.ts +0 -0
  73. /package/{dist → types}/themes/presets/index.d.ts +0 -0
  74. /package/{dist → types}/themes/presets/shared.d.ts +0 -0
  75. /package/{dist → types}/themes/shadows.d.ts +0 -0
  76. /package/{dist → types}/themes/themes.d.ts +0 -0
  77. /package/{dist → types}/ui-provider/index.d.ts +0 -0
  78. /package/{dist → types}/ui-provider/theme-provider.d.ts +0 -0
  79. /package/{dist → types}/ui-provider/ui-provider.d.ts +0 -0
  80. /package/{dist → types}/use-all-themes/all-themes-context.d.ts +0 -0
  81. /package/{dist → types}/use-all-themes/index.d.ts +0 -0
  82. /package/{dist → types}/use-classes/index.d.ts +0 -0
  83. /package/{dist → types}/use-classes/use-classes.d.ts +0 -0
  84. /package/{dist → types}/use-current-state/index.d.ts +0 -0
  85. /package/{dist → types}/use-current-state/use-current-state.d.ts +0 -0
  86. /package/{dist → types}/use-media-query/index.d.ts +0 -0
  87. /package/{dist → types}/use-media-query/use-media-query.d.ts +0 -0
  88. /package/{dist → types}/use-theme/index.d.ts +0 -0
  89. /package/{dist → types}/use-theme/theme-context.d.ts +0 -0
  90. /package/{dist → types}/use-toasts/helpers.d.ts +0 -0
  91. /package/{dist → types}/use-toasts/index.d.ts +0 -0
  92. /package/{dist → types}/use-toasts/toast-container.d.ts +0 -0
  93. /package/{dist → types}/use-toasts/toast-item.d.ts +0 -0
  94. /package/{dist → types}/use-toasts/use-toast.d.ts +0 -0
  95. /package/{dist → types}/utils/collections.d.ts +0 -0
  96. /package/{dist → types}/utils/color.d.ts +0 -0
  97. /package/{dist → types}/utils/layouts.d.ts +0 -0
  98. /package/{dist → types}/utils/prop-types.d.ts +0 -0
  99. /package/{dist → types}/utils/types.d.ts +0 -0
  100. /package/{dist → types}/utils/use-click-anywhere.d.ts +0 -0
  101. /package/{dist → types}/utils/use-current-state.d.ts +0 -0
  102. /package/{dist → types}/utils/use-dom-observer.d.ts +0 -0
  103. /package/{dist → types}/utils/use-hd-ui-context.d.ts +0 -0
  104. /package/{dist → types}/utils/use-portal.d.ts +0 -0
  105. /package/{dist → types}/utils/use-previous.d.ts +0 -0
  106. /package/{dist → types}/utils/use-real-shape.d.ts +0 -0
  107. /package/{dist → types}/utils/use-resize.d.ts +0 -0
  108. /package/{dist → types}/utils/use-ssr.d.ts +0 -0
  109. /package/{dist → types}/utils/use-warning.d.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@helpdice/theme",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "main": "dist/index.js",
5
5
  "types": "esm/index.d.ts",
6
6
  "unpkg": "dist/index.min.js",
@@ -20,9 +20,9 @@
20
20
  "build:clear": "rm -rf ./dist ./esm",
21
21
  "build:rollup": "rollup --bundleConfigAsCjs -c scripts/rollup.config.js",
22
22
  "build:webpack": "webpack --config scripts/webpack.config.js",
23
- "build:babel": "babel --no-babelrc --config-file ./scripts/babel.config.js --extensions \".js,.ts,.tsx\" ./components --out-dir ./esm --ignore \"**/__tests__/**/*,**/*.d.ts\"",
24
- "build:after": "node scripts/move-built-in.js",
25
- "build:types": "tsc -p ./scripts & tsc -p ./scripts --outDir ./esm",
23
+ "build:babel": "npx babel --no-babelrc --config-file ./scripts/babel.config.js --extensions \".js,.ts,.tsx\" ./components --out-dir ./esm --ignore \"**/__tests__/**/*,**/*.d.ts\"",
24
+ "build:after": "node scripts/move-built-in.js && node scripts/generate-exports.js",
25
+ "build:types": "tsc -p ./scripts --outDir ./types",
26
26
  "build:package": "yarn build:rollup && yarn build:babel && yarn build:types && yarn build:after",
27
27
  "release": "yarn publish --access public --non-interactive",
28
28
  "release:github": "yarn publish --registry=https://npm.pkg.github.com"
@@ -51,7 +51,8 @@
51
51
  ],
52
52
  "files": [
53
53
  "/dist",
54
- "/esm"
54
+ "/esm",
55
+ "/types"
55
56
  ],
56
57
  "sideEffects": false,
57
58
  "devDependencies": {
@@ -101,7 +102,7 @@
101
102
  "tslib": "^2.8.1"
102
103
  },
103
104
  "peerDependencies": {
104
- "@helpdice/sdk": "^0.4.3",
105
+ "@helpdice/sdk": "^0.5.4",
105
106
  "react": "^18.3.1 || ^19.1.0"
106
107
  },
107
108
  "jest": {
@@ -114,5 +115,85 @@
114
115
  "setupFilesAfterEnv": [
115
116
  "<rootDir>/test/setupTests.ts"
116
117
  ]
118
+ },
119
+ "exports": {
120
+ ".": {
121
+ "types": "./types/index.d.ts",
122
+ "import": "./dist/index.js"
123
+ },
124
+ "./CssBaseline": {
125
+ "types": "./types/css-baseline/index.d.ts",
126
+ "import": "./dist/css-baseline/index.js"
127
+ },
128
+ "./Subscription": {
129
+ "types": "./types/subscription/index.d.ts",
130
+ "import": "./dist/subscription/index.js"
131
+ },
132
+ "./Themes": {
133
+ "types": "./types/themes/index.d.ts",
134
+ "import": "./dist/themes/index.js"
135
+ },
136
+ "./UiProvider": {
137
+ "types": "./types/ui-provider/index.d.ts",
138
+ "import": "./dist/ui-provider/index.js"
139
+ },
140
+ "./useAllThemes": {
141
+ "types": "./types/use-all-themes/index.d.ts",
142
+ "import": "./dist/use-all-themes/index.js"
143
+ },
144
+ "./useClasses": {
145
+ "types": "./types/use-classes/index.d.ts",
146
+ "import": "./dist/use-classes/index.js"
147
+ },
148
+ "./useCurrentState": {
149
+ "types": "./types/use-current-state/index.d.ts",
150
+ "import": "./dist/use-current-state/index.js"
151
+ },
152
+ "./useMediaQuery": {
153
+ "types": "./types/use-media-query/index.d.ts",
154
+ "import": "./dist/use-media-query/index.js"
155
+ },
156
+ "./useTheme": {
157
+ "types": "./types/use-theme/index.d.ts",
158
+ "import": "./dist/use-theme/index.js"
159
+ },
160
+ "./useToasts": {
161
+ "types": "./types/use-toasts/index.d.ts",
162
+ "import": "./dist/use-toasts/index.js"
163
+ }
164
+ },
165
+ "typesVersions": {
166
+ "*": {
167
+ "CssBaseline": [
168
+ "dist/css-baseline/index.d.ts"
169
+ ],
170
+ "Subscription": [
171
+ "dist/subscription/index.d.ts"
172
+ ],
173
+ "Themes": [
174
+ "dist/themes/index.d.ts"
175
+ ],
176
+ "UiProvider": [
177
+ "dist/ui-provider/index.d.ts"
178
+ ],
179
+ "useAllThemes": [
180
+ "dist/use-all-themes/index.d.ts"
181
+ ],
182
+ "useClasses": [
183
+ "dist/use-classes/index.d.ts"
184
+ ],
185
+ "useCurrentState": [
186
+ "dist/use-current-state/index.d.ts"
187
+ ],
188
+ "useMediaQuery": [
189
+ "dist/use-media-query/index.d.ts"
190
+ ],
191
+ "useTheme": [
192
+ "dist/use-theme/index.d.ts"
193
+ ],
194
+ "useToasts": [
195
+ "dist/use-toasts/index.d.ts"
196
+ ]
197
+ }
117
198
  }
118
- }
199
+ }
@@ -1,10 +0,0 @@
1
- import React, { ReactElement } from 'react';
2
- import flush from 'styled-jsx';
3
- export type FlushToReact = <T>(opts?: {
4
- nonce?: string;
5
- }) => Array<ReactElement<T>>;
6
- type MemoCssBaselineComponent<P = {}> = React.NamedExoticComponent<P> & {
7
- flush: typeof flush.StyleRegistry;
8
- };
9
- declare const MemoCssBaseline: MemoCssBaselineComponent<React.PropsWithChildren<unknown>>;
10
- export default MemoCssBaseline;
@@ -1 +0,0 @@
1
- export { default } from './css-baseline';
package/esm/index.d.ts DELETED
@@ -1,25 +0,0 @@
1
- export { default as UiProvider } from './ui-provider';
2
- export type { UiProviderProps } from './ui-provider';
3
- export { default as Themes } from './themes';
4
- export type { HUIThemes, HUserTheme } from './themes';
5
- export { default as useAllThemes } from './use-all-themes';
6
- export type { AllThemesConfig } from './use-all-themes';
7
- export { default as CssBaseline } from './css-baseline';
8
- export { useRect } from './utils/layouts';
9
- export type { ReactiveDomReact } from './utils/layouts';
10
- export { default as useCurrentState } from './use-current-state';
11
- export { default as useTheme } from './use-theme';
12
- export { default as useClasses } from './use-classes';
13
- export { default as useToasts } from './use-toasts';
14
- export type { Toast, ToastInput, ToastAction, ToastLayout } from './use-toasts';
15
- export { default as useMediaQuery } from './use-media-query';
16
- export type { ResponsiveOptions, ResponsiveBreakpoint } from './use-media-query';
17
- export { default as Highlight } from './shared/highlight';
18
- export type { HighlightProps } from './shared/highlight';
19
- export { default as Ellipsis } from './shared/ellipsis';
20
- export { default as Expand } from './shared/expand';
21
- export { default as Dropdown } from './shared/dropdown';
22
- export { default as CssTransition } from './shared/css-transition';
23
- export { default as Backdrop } from './shared/backdrop';
24
- export { addColorAlpha, colorToRgbValues } from './utils/color';
25
- export { withSubscription } from './subscription';
@@ -1,14 +0,0 @@
1
- import React, { MouseEvent } from 'react';
2
- interface Props {
3
- onClick?: (event: MouseEvent<HTMLElement>) => void;
4
- visible?: boolean;
5
- width?: string;
6
- onContentClick?: (event: MouseEvent<HTMLElement>) => void;
7
- backdropClassName?: string;
8
- positionClassName?: string;
9
- layerClassName?: string;
10
- }
11
- type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
12
- export type BackdropProps = Props & NativeAttrs;
13
- declare const Backdrop: React.FC<React.PropsWithChildren<BackdropProps>>;
14
- export default Backdrop;
@@ -1,13 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- interface Props {
3
- visible?: boolean;
4
- enterTime?: number;
5
- leaveTime?: number;
6
- clearTime?: number;
7
- className?: string;
8
- name?: string;
9
- children: ReactNode;
10
- }
11
- export type CssTransitionProps = Props;
12
- declare const CssTransition: React.FC<CssTransitionProps>;
13
- export default CssTransition;
@@ -1,9 +0,0 @@
1
- import React, { MutableRefObject } from 'react';
2
- interface Props {
3
- parent?: MutableRefObject<HTMLElement | null> | undefined;
4
- visible: boolean;
5
- disableMatchWidth?: boolean;
6
- getPopupContainer?: () => HTMLElement | null;
7
- }
8
- declare const Dropdown: React.FC<React.PropsWithChildren<Props>>;
9
- export default Dropdown;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- export type EllipsisProps = {
3
- height: string;
4
- };
5
- declare const _default: React.NamedExoticComponent<React.PropsWithChildren<EllipsisProps>>;
6
- export default _default;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export type ExpandProps = {
3
- isExpanded?: boolean;
4
- delay?: number;
5
- };
6
- declare const Expand: React.FC<React.PropsWithChildren<ExpandProps>>;
7
- export default Expand;
@@ -1,13 +0,0 @@
1
- import React from 'react';
2
- import { ReactiveDomReact } from '../utils/layouts';
3
- type Props = {
4
- rect: ReactiveDomReact;
5
- visible?: boolean;
6
- hoverHeightRatio?: number;
7
- hoverWidthRatio?: number;
8
- activeOpacity?: number;
9
- };
10
- type NativeAttrs = Omit<React.HTMLAttributes<any>, keyof Props>;
11
- export type HighlightProps = Props & NativeAttrs;
12
- declare const Highlight: React.FC<HighlightProps>;
13
- export default Highlight;
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- type SubscriptionState = {
3
- status: 'loading';
4
- } | {
5
- status: 'active' | 'expired' | 'trial' | 'inactive';
6
- } | {
7
- status: 'error';
8
- reason: 'OFFLINE' | 'SERVER_DOWN' | 'UNAUTHORIZED';
9
- };
10
- export declare const SubscriptionProvider: React.FC<{
11
- children: React.ReactNode;
12
- }>;
13
- export declare const useSubscription: () => SubscriptionState;
14
- export {};
@@ -1,5 +0,0 @@
1
- import React from "react";
2
- declare const SubscriptionError: ({ reason }: {
3
- reason: string;
4
- }) => React.JSX.Element;
5
- export default SubscriptionError;
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- declare const UpgradeNotice: () => React.JSX.Element;
3
- export default UpgradeNotice;
@@ -1,3 +0,0 @@
1
- import { SubscriptionProvider } from "./SubscriptionContext";
2
- import { withSubscription } from "./withSubscription";
3
- export { withSubscription, SubscriptionProvider };
@@ -1,2 +0,0 @@
1
- import React from 'react';
2
- export declare const withSubscription: (Component: React.FC) => (props: any) => React.JSX.Element;
@@ -1,4 +0,0 @@
1
- import Themes from './themes';
2
- export type { HUserTheme } from './themes';
3
- export type { HUIThemes, HUIThemesBreakpoints, BreakpointsItem, HUIThemesExpressiveness, HUIThemesFont, HUIThemesLayout, HUIThemesPalette, } from './presets';
4
- export default Themes;
@@ -1,8 +0,0 @@
1
- import { HUIThemes, HUIThemesPalette, HUIThemesExpressiveness } from './index';
2
- export declare const palette: HUIThemesPalette;
3
- export declare const expressiveness: HUIThemesExpressiveness;
4
- export declare const font: import("./index").HUIThemesFont;
5
- export declare const breakpoints: import("./index").HUIThemesBreakpoints;
6
- export declare const layout: import("./index").HUIThemesLayout;
7
- export declare const themes: HUIThemes;
8
- export default themes;
@@ -1,8 +0,0 @@
1
- import { HUIThemes, HUIThemesPalette, HUIThemesExpressiveness } from './index';
2
- export declare const palette: HUIThemesPalette;
3
- export declare const expressiveness: HUIThemesExpressiveness;
4
- export declare const font: import("./index").HUIThemesFont;
5
- export declare const breakpoints: import("./index").HUIThemesBreakpoints;
6
- export declare const layout: import("./index").HUIThemesLayout;
7
- export declare const themes: HUIThemes;
8
- export default themes;
@@ -1,99 +0,0 @@
1
- export interface HUIThemesPalette {
2
- accents_1: string;
3
- accents_2: string;
4
- accents_3: string;
5
- accents_4: string;
6
- accents_5: string;
7
- accents_6: string;
8
- accents_7: string;
9
- accents_8: string;
10
- background: string;
11
- foreground: string;
12
- selection: string;
13
- secondary: string;
14
- code: string;
15
- border: string;
16
- success: string;
17
- successLighter: string;
18
- successLight: string;
19
- successDark: string;
20
- error: string;
21
- errorLighter: string;
22
- errorLight: string;
23
- errorDark: string;
24
- warning: string;
25
- warningLighter: string;
26
- warningLight: string;
27
- warningDark: string;
28
- cyan: string;
29
- cyanLighter: string;
30
- cyanLight: string;
31
- cyanDark: string;
32
- violet: string;
33
- violetLighter: string;
34
- violetLight: string;
35
- violetDark: string;
36
- link: string;
37
- purple: string;
38
- magenta: string;
39
- alert: string;
40
- }
41
- export interface HUIThemesExpressiveness {
42
- linkStyle: string;
43
- linkHoverStyle: string;
44
- dropdownBoxShadow: string;
45
- scrollerStart: string;
46
- scrollerEnd: string;
47
- shadowSmall: string;
48
- shadowMedium: string;
49
- shadowLarge: string;
50
- portalOpacity: number;
51
- }
52
- export interface HUIThemesLayout {
53
- gap: string;
54
- gapNegative: string;
55
- gapHalf: string;
56
- gapHalfNegative: string;
57
- gapQuarter: string;
58
- gapQuarterNegative: string;
59
- pageMargin: string;
60
- pageWidth: string;
61
- pageWidthWithMargin: string;
62
- breakpointMobile: string;
63
- breakpointTablet: string;
64
- radius: string;
65
- unit: string;
66
- }
67
- export interface HUIThemesFont {
68
- sans: string;
69
- mono: string;
70
- prism: string;
71
- }
72
- export interface BreakpointsItem {
73
- min: string;
74
- max: string;
75
- }
76
- export interface HUIThemesBreakpoints {
77
- xs: BreakpointsItem;
78
- sm: BreakpointsItem;
79
- md: BreakpointsItem;
80
- lg: BreakpointsItem;
81
- xl: BreakpointsItem;
82
- }
83
- export interface HUIThemesShadow {
84
- drop: Record<string, string>;
85
- level: Record<string, string>;
86
- border: Record<string, string>;
87
- inner: Record<string, string>;
88
- float: Record<string, string>;
89
- top: Record<string, string>;
90
- }
91
- export interface HUIThemes {
92
- type: string;
93
- font: HUIThemesFont;
94
- layout: HUIThemesLayout;
95
- palette: HUIThemesPalette;
96
- breakpoints: HUIThemesBreakpoints;
97
- expressiveness: HUIThemesExpressiveness;
98
- shadows: HUIThemesShadow;
99
- }
@@ -1,4 +0,0 @@
1
- import { HUIThemesBreakpoints, HUIThemesFont, HUIThemesLayout } from './index';
2
- export declare const defaultFont: HUIThemesFont;
3
- export declare const defaultBreakpoints: HUIThemesBreakpoints;
4
- export declare const defaultLayout: HUIThemesLayout;
@@ -1,82 +0,0 @@
1
- export declare const shadows: {
2
- drop: {
3
- z1: string;
4
- z2: string;
5
- z3: string;
6
- };
7
- level: {
8
- z1: string;
9
- z2: string;
10
- z3: string;
11
- z4: string;
12
- z5: string;
13
- z6: string;
14
- z7: string;
15
- z8: string;
16
- z9: string;
17
- z10: string;
18
- z11: string;
19
- z12: string;
20
- z13: string;
21
- z14: string;
22
- z15: string;
23
- z16: string;
24
- z17: string;
25
- z18: string;
26
- z19: string;
27
- z20: string;
28
- z21: string;
29
- z22: string;
30
- z23: string;
31
- z24: string;
32
- z25: string;
33
- z26: string;
34
- z27: string;
35
- z28: string;
36
- z29: string;
37
- z30: string;
38
- z31: string;
39
- };
40
- border: {
41
- z1: string;
42
- z2: string;
43
- z3: string;
44
- z4: string;
45
- z5: string;
46
- z6: string;
47
- z7: string;
48
- z8: string;
49
- z9: string;
50
- z10: string;
51
- z11: string;
52
- z12: string;
53
- z13: string;
54
- z14: string;
55
- z15: string;
56
- z16: string;
57
- z17: string;
58
- };
59
- inner: {
60
- z1: string;
61
- z2: string;
62
- z3: string;
63
- z4: string;
64
- };
65
- float: {
66
- z1: string;
67
- z2: string;
68
- z3: string;
69
- z4: string;
70
- z5: string;
71
- z6: string;
72
- z7: string;
73
- z8: string;
74
- z9: string;
75
- };
76
- top: {
77
- z1: string;
78
- z2: string;
79
- z3: string;
80
- z4: string;
81
- };
82
- };
@@ -1,18 +0,0 @@
1
- import { HUIThemes } from './presets/index';
2
- import type { DeepPartial } from '../utils/types';
3
- export type HUserTheme = DeepPartial<HUIThemes> & {
4
- type: string;
5
- };
6
- export declare const isObject: (target: unknown) => unknown;
7
- export declare const deepDuplicable: <T extends Record<string, unknown>>(source: T, target: T) => T;
8
- declare const Themes: {
9
- isPresetTheme: (themeOrType?: HUserTheme | HUIThemes | string) => boolean;
10
- isAvailableThemeType: (type?: string) => boolean;
11
- hasUserCustomTheme: (themes?: Array<HUIThemes>) => boolean;
12
- getPresets: () => Array<HUIThemes>;
13
- getPresetStaticTheme: () => HUIThemes;
14
- create: (base: HUIThemes, custom: HUserTheme) => HUIThemes;
15
- createFromDark: (custom: HUserTheme) => HUIThemes;
16
- createFromLight: (custom: HUserTheme) => HUIThemes;
17
- };
18
- export default Themes;
@@ -1,3 +0,0 @@
1
- import HuiProvider from './ui-provider';
2
- export type { UiProviderProps } from './ui-provider';
3
- export default HuiProvider;
@@ -1,8 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { HUIThemes } from '../themes/presets';
3
- export interface Props {
4
- themeType?: string;
5
- themes?: Array<HUIThemes>;
6
- }
7
- declare const ThemeProvider: React.FC<PropsWithChildren<Props>>;
8
- export default ThemeProvider;
@@ -1,8 +0,0 @@
1
- import React, { PropsWithChildren } from 'react';
2
- import { HUIThemes } from '../themes/presets';
3
- export type UiProviderProps = {
4
- themes?: Array<HUIThemes>;
5
- themeType?: string | 'dark' | 'light';
6
- };
7
- declare const HuiProvider: React.FC<PropsWithChildren<UiProviderProps>>;
8
- export default HuiProvider;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- import { HUIThemes } from '../themes/presets';
3
- export type AllThemesConfig = {
4
- themes: Array<HUIThemes>;
5
- };
6
- export declare const AllThemesContext: React.Context<AllThemesConfig>;
7
- export declare const useAllThemes: () => AllThemesConfig;
@@ -1,3 +0,0 @@
1
- import { useAllThemes } from './all-themes-context';
2
- export type { AllThemesConfig } from './all-themes-context';
3
- export default useAllThemes;
@@ -1,2 +0,0 @@
1
- import { default as useClasses } from './use-classes';
2
- export default useClasses;
@@ -1,4 +0,0 @@
1
- export type classNamesObject = Record<string, boolean | string | number | null | undefined>;
2
- export type className = string | classNamesObject | null | undefined | boolean | number;
3
- declare const useClasses: (...classNames: Array<className>) => string;
4
- export default useClasses;
@@ -1,2 +0,0 @@
1
- import useCurrentState from './use-current-state';
2
- export default useCurrentState;
@@ -1,4 +0,0 @@
1
- import { Dispatch, MutableRefObject, SetStateAction } from 'react';
2
- export type CurrentStateType<S> = [S, Dispatch<SetStateAction<S>>, MutableRefObject<S>];
3
- declare const useCurrentState: <S>(initialState: S | (() => S)) => CurrentStateType<S>;
4
- export default useCurrentState;
@@ -1,3 +0,0 @@
1
- import useMediaQuery from './use-media-query';
2
- export type { ResponsiveBreakpoint, ResponsiveOptions } from './use-media-query';
3
- export default useMediaQuery;
@@ -1,12 +0,0 @@
1
- declare const breakpoints: ["xs", "sm", "md", "lg", "xl", "mobile"];
2
- export type ResponsiveBreakpoint = typeof breakpoints[number];
3
- declare const matchType: ["up", "down", "default"];
4
- export type ResponsiveMatchType = typeof matchType[number];
5
- export type ResponsiveOptions = {
6
- match?: ResponsiveMatchType;
7
- ssrMatchMedia?: (query: string) => {
8
- matches: boolean;
9
- };
10
- };
11
- declare const useMediaQuery: (breakpoint: ResponsiveBreakpoint, options?: ResponsiveOptions) => boolean;
12
- export default useMediaQuery;
@@ -1,2 +0,0 @@
1
- import { useTheme } from './theme-context';
2
- export default useTheme;
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import { HUIThemes } from '../themes/presets';
3
- export declare const ThemeContext: React.Context<HUIThemes>;
4
- export declare const useTheme: () => HUIThemes;
@@ -1,18 +0,0 @@
1
- import { Toast } from './use-toast';
2
- import React from 'react';
3
- import { HUIThemesPalette } from '../themes';
4
- import { NormalTypes } from '../utils/prop-types';
5
- export declare const makeToastActions: (actions: Toast["actions"], cancelHandle: () => void) => React.JSX.Element[] | null;
6
- export declare const getColors: (palette: HUIThemesPalette, type?: NormalTypes) => {
7
- bgColor: string;
8
- color: string;
9
- };
10
- declare const toastPlacement: ["topLeft", "topRight", "bottomLeft", "bottomRight"];
11
- export type ToastPlacement = typeof toastPlacement[number];
12
- export declare const isTopPlacement: (placement: ToastPlacement) => boolean;
13
- export declare const isLeftPlacement: (placement: ToastPlacement) => boolean;
14
- export declare const getTranslateByPlacement: (placement: ToastPlacement) => {
15
- enter: string;
16
- leave: string;
17
- };
18
- export {};
@@ -1,3 +0,0 @@
1
- import useToasts from './use-toast';
2
- export type { ToastAction, Toast, ToastTypes, ToastInput, ToastLayout } from './use-toast';
3
- export default useToasts;
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const ToastContainer: React.FC<React.PropsWithChildren<unknown>>;
3
- export default ToastContainer;
@@ -1,8 +0,0 @@
1
- import React from 'react';
2
- import type { Toast, ToastLayout } from './use-toast';
3
- export interface ToastItemProps {
4
- toast: Toast;
5
- layout: Required<ToastLayout>;
6
- }
7
- declare const ToastItem: React.FC<ToastItemProps>;
8
- export default ToastItem;
@@ -1,40 +0,0 @@
1
- import React, { CSSProperties } from 'react';
2
- import type { NormalTypes } from '../utils/prop-types';
3
- import { ToastPlacement } from '../use-toasts/helpers';
4
- export interface ToastAction {
5
- name: string;
6
- handler: (event: React.MouseEvent<HTMLButtonElement>, cancel: () => void) => void;
7
- passive?: boolean;
8
- }
9
- export type ToastTypes = NormalTypes;
10
- export type ToastLayout = {
11
- padding?: CSSProperties['padding'];
12
- margin?: CSSProperties['margin'];
13
- width?: CSSProperties['width'];
14
- maxWidth?: CSSProperties['maxWidth'];
15
- maxHeight?: CSSProperties['maxHeight'];
16
- placement?: ToastPlacement;
17
- };
18
- export interface ToastInput {
19
- text: string | React.ReactNode;
20
- type?: ToastTypes;
21
- id?: string;
22
- delay?: number;
23
- actions?: Array<ToastAction>;
24
- }
25
- export type ToastInstance = {
26
- visible: boolean;
27
- cancel: () => void;
28
- _timeout: null | number;
29
- _internalIdent: string;
30
- };
31
- export type Toast = Required<ToastInput> & ToastInstance;
32
- export type ToastHooksResult = {
33
- toasts: Array<Toast>;
34
- setToast: (toast: ToastInput) => void;
35
- removeAll: () => void;
36
- findToastOneByID: (ident: string) => Toast | undefined;
37
- removeToastOneByID: (ident: string) => void;
38
- };
39
- declare const useToasts: (layout?: ToastLayout) => ToastHooksResult;
40
- export default useToasts;
@@ -1,15 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- export declare const getId: () => string;
3
- export declare const capitalize: (str: string | symbol | number | undefined | null) => string;
4
- export declare const hasChild: (children: ReactNode | undefined, child: React.ElementType) => boolean;
5
- export declare const pickChild: (children: ReactNode | undefined, targetChild: React.ElementType) => [ReactNode | undefined, ReactNode | undefined];
6
- export declare const pickChildByProps: (children: ReactNode | undefined, key: string, value: any) => [ReactNode | undefined, ReactNode | undefined];
7
- export declare const pickChildrenFirst: (children: ReactNode | undefined) => ReactNode | undefined;
8
- export declare const setChildrenProps: (children: ReactNode | undefined, props: Record<string, unknown>, targetComponents?: Array<React.ElementType>) => ReactNode | undefined;
9
- export declare const setChildrenIndex: (children: ReactNode | undefined, targetComponents?: Array<React.ElementType>) => ReactNode | undefined;
10
- export declare const getReactNode: (node?: React.ReactNode | (() => React.ReactNode)) => React.ReactNode;
11
- export declare const isChildElement: (parent: Element | null | undefined, child: Element | null | undefined) => boolean;
12
- export declare const isUiElement: (el?: HTMLElement) => boolean;
13
- export declare const isBrowser: () => boolean;
14
- export declare const isMac: () => boolean;
15
- export declare const isCSSNumberValue: (value?: string | number) => boolean;
@@ -1,2 +0,0 @@
1
- export declare const colorToRgbValues: (color: string) => number[];
2
- export declare const addColorAlpha: (color: string, alpha: number) => string;
@@ -1,20 +0,0 @@
1
- import { MouseEvent, FocusEvent, MutableRefObject } from 'react';
2
- export declare const getElementOffset: (el?: HTMLElement | null | undefined) => {
3
- top: number;
4
- left: number;
5
- };
6
- export interface ReactiveDomReact {
7
- top: number;
8
- left: number;
9
- right: number;
10
- width: number;
11
- height: number;
12
- elementTop: number;
13
- }
14
- export declare const isUnplacedRect: (rect?: ReactiveDomReact) => boolean;
15
- export declare const getRefRect: (ref?: MutableRefObject<HTMLElement | null>, getContainer?: () => HTMLElement | null) => ReactiveDomReact;
16
- export declare const getEventRect: (event?: MouseEvent<HTMLElement> | FocusEvent<HTMLElement>, getContainer?: () => HTMLElement | null) => ReactiveDomReact;
17
- export declare const useRect: (initialState?: ReactiveDomReact | (() => ReactiveDomReact)) => {
18
- rect: ReactiveDomReact;
19
- setRect: (eventOrRef: MouseEvent<HTMLElement> | FocusEvent<HTMLElement> | MutableRefObject<HTMLElement | null>, getContainer?: () => HTMLElement | null) => void;
20
- };
@@ -1,19 +0,0 @@
1
- export declare const tuple: <T extends string[]>(...args: T) => T;
2
- export declare const tupleNumber: <T extends number[]>(...args: T) => T;
3
- declare const buttonTypes: ["default", "secondary", "success", "warning", "error", "abort", "secondary-light", "success-light", "warning-light", "error-light"];
4
- declare const normalTypes: ["default", "secondary", "success", "warning", "error"];
5
- declare const snippetTypes: ["default", "secondary", "success", "warning", "error", "dark", "lite"];
6
- declare const cardTypes: ["default", "secondary", "success", "warning", "error", "dark", "lite", "alert", "purple", "violet", "cyan"];
7
- declare const copyTypes: ["default", "silent", "prevent"];
8
- declare const triggerTypes: ["hover", "click"];
9
- declare const placement: ["top", "topStart", "topEnd", "left", "leftStart", "leftEnd", "bottom", "bottomStart", "bottomEnd", "right", "rightStart", "rightEnd"];
10
- declare const dividerAlign: ["start", "center", "end", "left", "right"];
11
- export type ButtonTypes = typeof buttonTypes[number];
12
- export type NormalTypes = typeof normalTypes[number];
13
- export type SnippetTypes = typeof snippetTypes[number];
14
- export type CardTypes = typeof cardTypes[number];
15
- export type CopyTypes = typeof copyTypes[number];
16
- export type TriggerTypes = typeof triggerTypes[number];
17
- export type Placement = typeof placement[number];
18
- export type DividerAlign = typeof dividerAlign[number];
19
- export {};
@@ -1,3 +0,0 @@
1
- export type DeepPartial<T> = {
2
- [P in keyof T]?: T[P] extends Record<string, any> ? DeepPartial<T[P]> : T[P];
3
- };
@@ -1,2 +0,0 @@
1
- declare const useClickAnyWhere: (handler: (event: Event) => void) => void;
2
- export default useClickAnyWhere;
@@ -1,2 +0,0 @@
1
- import useCurrentState from '../use-current-state';
2
- export default useCurrentState;
@@ -1,3 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- declare const useDOMObserver: (ref: MutableRefObject<HTMLElement | null> | undefined, callback?: MutationCallback) => void;
3
- export default useDOMObserver;
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import type { ToastLayout, Toast } from '../use-toasts/use-toast';
3
- export declare const defaultToastLayout: Required<ToastLayout>;
4
- export type UpdateToastsFunction = (fn: (toasts: Array<Toast>) => Array<Toast>) => any;
5
- export type UpdateToastsLayoutFunction = (fn: (layout: Required<ToastLayout>) => Required<ToastLayout>) => any;
6
- export type UpdateToastsIDFunction = (fn: () => string | null) => any;
7
- export interface HUIContextParams {
8
- toasts: Array<Toast>;
9
- updateToasts: UpdateToastsFunction;
10
- toastLayout: Required<ToastLayout>;
11
- updateToastLayout: UpdateToastsLayoutFunction;
12
- lastUpdateToastId: string | null;
13
- updateLastToastId: UpdateToastsIDFunction;
14
- }
15
- export declare const HUIContent: React.Context<HUIContextParams>;
16
- export declare const useHUIContext: () => HUIContextParams;
@@ -1,2 +0,0 @@
1
- declare const usePortal: (selectId?: string, getContainer?: () => HTMLElement | null) => HTMLElement | null;
2
- export default usePortal;
@@ -1,2 +0,0 @@
1
- declare const usePrevious: <T>(state: T) => T | undefined | null;
2
- export default usePrevious;
@@ -1,9 +0,0 @@
1
- import { MutableRefObject } from 'react';
2
- export type ShapeType = {
3
- width: number;
4
- height: number;
5
- };
6
- export declare const getRealShape: (el: HTMLElement | null) => ShapeType;
7
- export type ShapeResult = [ShapeType, () => void];
8
- declare const useRealShape: <T extends HTMLElement>(ref: MutableRefObject<T | null>) => ShapeResult;
9
- export default useRealShape;
@@ -1,2 +0,0 @@
1
- declare const useResize: (callback: () => unknown, immediatelyInvoke?: boolean) => void;
2
- export default useResize;
@@ -1,6 +0,0 @@
1
- export type SSRState = {
2
- isBrowser: boolean;
3
- isServer: boolean;
4
- };
5
- declare const useSSR: () => SSRState;
6
- export default useSSR;
@@ -1,2 +0,0 @@
1
- declare const useWarning: (message: string, component?: string) => void;
2
- export default useWarning;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes