@protonradio/proton-ui 0.11.0-beta.18 → 0.11.0-beta.2
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/README.md +73 -153
- package/dist/constants.cjs.js +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.d.ts +147 -4
- package/dist/constants.es.js +19 -7
- package/dist/constants.es.js.map +1 -1
- package/dist/hooks.cjs.js +1 -1
- package/dist/hooks.cjs.js.map +1 -1
- package/dist/hooks.d.ts +5 -34
- package/dist/hooks.es.js +4 -36
- package/dist/hooks.es.js.map +1 -1
- package/dist/icons.svg +10 -10
- package/dist/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +296 -500
- package/dist/index.es.js +11462 -10177
- package/dist/index.es.js.map +1 -1
- package/dist/palettes-BX86v-qb.js +2 -0
- package/dist/palettes-BX86v-qb.js.map +1 -0
- package/dist/palettes-mcF0lNKY.mjs +171 -0
- package/dist/palettes-mcF0lNKY.mjs.map +1 -0
- package/dist/style.css +1 -1
- package/dist/useBreakpoint-CjRyGKN-.mjs.map +1 -1
- package/dist/useBreakpoint-DA-JqOu3.js.map +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.d.ts +44 -32
- package/dist/utils.es.js +451 -17
- package/dist/utils.es.js.map +1 -1
- package/package.json +100 -104
- package/dist/breakpoint-9y1_8U_b.mjs +0 -10
- package/dist/breakpoint-9y1_8U_b.mjs.map +0 -1
- package/dist/breakpoint-DtqbboOa.js +0 -2
- package/dist/breakpoint-DtqbboOa.js.map +0 -1
- package/dist/darkTheme-DUWn6YJ-.mjs +0 -345
- package/dist/darkTheme-DUWn6YJ-.mjs.map +0 -1
- package/dist/darkTheme-ann6VTfq.js +0 -2
- package/dist/darkTheme-ann6VTfq.js.map +0 -1
- package/dist/image-BlhKzTx8.js +0 -2
- package/dist/image-BlhKzTx8.js.map +0 -1
- package/dist/image-C8M6y5Op.mjs +0 -205
- package/dist/image-C8M6y5Op.mjs.map +0 -1
- package/dist/navigation-BB0MBIiR.js +0 -2
- package/dist/navigation-BB0MBIiR.js.map +0 -1
- package/dist/navigation-Bj7Pex9j.mjs +0 -43
- package/dist/navigation-Bj7Pex9j.mjs.map +0 -1
- package/dist/theme-DQsfWeLo.mjs +0 -12
- package/dist/theme-DQsfWeLo.mjs.map +0 -1
- package/dist/theme-Dc0Ahjq9.js +0 -2
- package/dist/theme-Dc0Ahjq9.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,153 +1,73 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
```
|
|
6
|
-
npm run storybook
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<YourApp />
|
|
75
|
-
</ThemeProvider>
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
## Best Styling Practices
|
|
81
|
-
|
|
82
|
-
Components use standardized _control_ variables defined in the theme config stylesheets for consistent styling across the design system:
|
|
83
|
-
|
|
84
|
-
```typescript
|
|
85
|
-
export interface ProtonStyleSheet {
|
|
86
|
-
"--proton-control__background-color": string;
|
|
87
|
-
"--proton-control__background-color-light": string;
|
|
88
|
-
"--proton-control__text-color": string;
|
|
89
|
-
"--proton-control__title-color": string;
|
|
90
|
-
"--proton-control__border-color": string;
|
|
91
|
-
"--proton-control__shadow-color": string;
|
|
92
|
-
// ... etc
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
These control variables unify the styling system while powering theme-specific CSS customization, and follow the pattern `--proton-control__{style}-{property}`:
|
|
96
|
-
|
|
97
|
-
```css
|
|
98
|
-
.myComponent {
|
|
99
|
-
background-color: var(--proton-control__background-color);
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
For more advanced theme overrides we utilize the theme class names. The `ThemeProvider` applies the appropriate theme class to its container, making it available to all child components. Theme class names follow the pattern `proton-ui__theme--{themeName}`:
|
|
104
|
-
|
|
105
|
-
```css
|
|
106
|
-
.proton-ui__theme--dark .myComponent[active] {
|
|
107
|
-
background-color: var(--proton-control__interactive-color);
|
|
108
|
-
}
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Palettes can also be accessed in JSX via the `useTheme` hook for more advanced use cases:
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```jsx
|
|
115
|
-
import { useTheme } from "@protonradio/proton-ui";
|
|
116
|
-
|
|
117
|
-
function MyComponent() {
|
|
118
|
-
const { palette } = useTheme();
|
|
119
|
-
|
|
120
|
-
// Prefer CSS selectors over programmatic styling
|
|
121
|
-
return <Icon color={palette.BRAND.PRIMARY} />;
|
|
122
|
-
}
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## Publishing Updates to NPM
|
|
126
|
-
|
|
127
|
-
We follow semantic versioning and use automated CI/CD for releases:
|
|
128
|
-
|
|
129
|
-
**For Beta Releases (Testing):**
|
|
130
|
-
|
|
131
|
-
```bash
|
|
132
|
-
npm run build
|
|
133
|
-
npm run publish-beta # Automated versioning with beta tag
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
**For Production Releases:**
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npm run build
|
|
140
|
-
npm version <patch|minor|major> # Semantic versioning
|
|
141
|
-
npm publish
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
**Best Practices:**
|
|
145
|
-
|
|
146
|
-
- Always publish beta releases first for testing across platforms
|
|
147
|
-
- Test on all supported environments before production release
|
|
148
|
-
- Use semantic versioning (patch for bug fixes, minor for features, major for breaking changes)
|
|
149
|
-
- Our GitHub Actions [NPM Version](https://github.com/protonradio/proton-ui/actions/workflows/npm_release.yml) tool automatically handles versioning and deployment workflows
|
|
150
|
-
|
|
151
|
-
## Recommended Reading
|
|
152
|
-
|
|
153
|
-
- https://www.gabe.pizza/notes-on-component-libraries/
|
|
1
|
+
# Proton UI
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
npm run storybook
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
### Publishing Updates to NPM
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
npm run build
|
|
13
|
+
npm version <new_version> // increment version in package.json accordingly using semver
|
|
14
|
+
npm publish
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Themes
|
|
18
|
+
|
|
19
|
+
This library supports themes for the various applications that use it. Ideally, we would unify our app designs, but until then themes is a way to support different design patterns using the same api.
|
|
20
|
+
|
|
21
|
+
#### Adding a Theme
|
|
22
|
+
|
|
23
|
+
The current supported themes can be found in the `src/themes/config.ts`. To add a new theme, create a new attribute on the `THEMES` object following the pattern `[themeName]: [themeClassName]`.
|
|
24
|
+
|
|
25
|
+
#### Styling for a theme
|
|
26
|
+
|
|
27
|
+
To apply theme specific styles in a component, we set theme specific css variables in the `src/themes/config.ts` file, in `generateThemeCssVariables` function. If you need more control, you can add either use the `useTheme` hook to manipulate the DOM, or you can use css selectors that reference the wrapping theme class.
|
|
28
|
+
|
|
29
|
+
For example, to apply a style to the dark theme, you can use the following css.
|
|
30
|
+
```css
|
|
31
|
+
.proton-ui__theme--dark .myComponent {
|
|
32
|
+
background-color: red;
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Implementing in your application
|
|
37
|
+
|
|
38
|
+
#### Prerequisites
|
|
39
|
+
|
|
40
|
+
1. Ensure you have access to Proton's `proton-ui` npm package
|
|
41
|
+
2. Login to npm using `npm login`
|
|
42
|
+
|
|
43
|
+
#### Install
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
npm install @protonradio/proton-ui --save
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
#### Import the styles
|
|
50
|
+
Then import the styles into your main.css file.
|
|
51
|
+
|
|
52
|
+
```css
|
|
53
|
+
@import "@protonradio/proton-ui/styles";
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Setup the theme provider
|
|
57
|
+
When applying to a project, you can import available themes using `THEMES` from this library and apply the theme an outer div on the application. See below for an example.
|
|
58
|
+
|
|
59
|
+
```jsx
|
|
60
|
+
import { ThemeProvider, THEMES } from "@protonradio/proton-ui";
|
|
61
|
+
|
|
62
|
+
function MyApp({ Component, pageProps }) {
|
|
63
|
+
return (
|
|
64
|
+
<ThemeProvider theme={THEMES.DARK}>
|
|
65
|
+
<Component {...pageProps} />
|
|
66
|
+
</ThemeProvider>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Recommended Reading
|
|
72
|
+
|
|
73
|
+
- https://www.gabe.pizza/notes-on-component-libraries/
|
package/dist/constants.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./palettes-BX86v-qb.js"),o={DARK:"dark",CUSTOM_DARK:"custom-dark",LIGHT:"light"},e=["bottom","bottom left","bottom right","bottom start","bottom end","top","top left","top right","top start","top end","left","left top","left bottom","start","start top","start bottom","right","right top","right bottom","end","end top","end bottom"],r={SMALL:576,MEDIUM:768,LARGE:992,X_LARGE:1200};exports.COLORS=t.colors;exports.DARK_MODE=t.DARK_MODE;exports.DEFAULT_BLACK_BACKGROUND=t.DEFAULT_BLACK_BACKGROUND;exports.DEFAULT_WHITE_BACKGROUND=t.DEFAULT_WHITE_BACKGROUND;exports.LIGHT_MODE=t.LIGHT_MODE;exports.BREAKPOINTS=r;exports.THEMES=o;exports.placements=e;
|
|
2
2
|
//# sourceMappingURL=constants.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.cjs.js","sources":["../src/constants/
|
|
1
|
+
{"version":3,"file":"constants.cjs.js","sources":["../src/constants/index.ts"],"sourcesContent":["import { Placement } from \"react-aria\";\n\nexport * as COLORS from \"./colors\";\n\nexport * from \"./palettes\";\n\nexport const THEMES = {\n DARK: \"dark\",\n CUSTOM_DARK: \"custom-dark\",\n LIGHT: \"light\",\n} as const;\n\nexport type Theme = (typeof THEMES)[keyof typeof THEMES];\n\nexport const placements: Placement[] = [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"bottom start\",\n \"bottom end\",\n \"top\",\n \"top left\",\n \"top right\",\n \"top start\",\n \"top end\",\n \"left\",\n \"left top\",\n \"left bottom\",\n \"start\",\n \"start top\",\n \"start bottom\",\n \"right\",\n \"right top\",\n \"right bottom\",\n \"end\",\n \"end top\",\n \"end bottom\",\n];\n\nexport const BREAKPOINTS = {\n SMALL: 576,\n MEDIUM: 768,\n LARGE: 992,\n X_LARGE: 1200,\n};\n\nexport type Breakpoint = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];\n"],"names":["THEMES","placements","BREAKPOINTS"],"mappings":"0HAMaA,EAAS,CACpB,KAAM,OACN,YAAa,cACb,MAAO,OACT,EAIaC,EAA0B,CACrC,SACA,cACA,eACA,eACA,aACA,MACA,WACA,YACA,YACA,UACA,OACA,WACA,cACA,QACA,YACA,eACA,QACA,YACA,eACA,MACA,UACA,YACF,EAEaC,EAAc,CACzB,MAAO,IACP,OAAQ,IACR,MAAO,IACP,QAAS,IACX"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Placement } from 'react-aria';
|
|
2
2
|
|
|
3
|
+
declare const BRAND: {
|
|
4
|
+
PRIMARY: string;
|
|
5
|
+
PRIMARY_LIGHT: string;
|
|
6
|
+
SECONDARY: string;
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
export declare type Breakpoint = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];
|
|
4
10
|
|
|
5
11
|
export declare const BREAKPOINTS: {
|
|
@@ -9,18 +15,155 @@ export declare const BREAKPOINTS: {
|
|
|
9
15
|
X_LARGE: number;
|
|
10
16
|
};
|
|
11
17
|
|
|
18
|
+
export declare namespace COLORS {
|
|
19
|
+
export {
|
|
20
|
+
BRAND,
|
|
21
|
+
DANGER,
|
|
22
|
+
WARNING,
|
|
23
|
+
SUCCESS,
|
|
24
|
+
GRAYSCALE,
|
|
25
|
+
SECONDARY,
|
|
26
|
+
DARK_GRAYSCALE,
|
|
27
|
+
DARK_SECONDARY
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
declare const DANGER: {
|
|
32
|
+
SUPER_DARK: string;
|
|
33
|
+
DARK: string;
|
|
34
|
+
MEDIUM: string;
|
|
35
|
+
LIGHT: string;
|
|
36
|
+
SUPER_LIGHT: string;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
declare const DARK_GRAYSCALE: {
|
|
40
|
+
GRAY_SUPER_DARK: string;
|
|
41
|
+
GRAY_DARK: string;
|
|
42
|
+
GRAY_MEDIUM: string;
|
|
43
|
+
GRAY_MEDIUM_LIGHT: string;
|
|
44
|
+
GRAY_LIGHT: string;
|
|
45
|
+
GRAY_LIGHTEST: string;
|
|
46
|
+
GRAY_SUPER_LIGHT: string;
|
|
47
|
+
WHITE: string;
|
|
48
|
+
BORDER: string;
|
|
49
|
+
ELEVATION: string;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export declare const DARK_MODE: Palette;
|
|
53
|
+
|
|
54
|
+
declare const DARK_SECONDARY: {
|
|
55
|
+
SECONDARY_SUPER_DARK: string;
|
|
56
|
+
SECONDARY_DARK: string;
|
|
57
|
+
SECONDARY_MEDIUM: string;
|
|
58
|
+
SECONDARY_MEDIUM_LIGHT: string;
|
|
59
|
+
SECONDARY_LIGHT: string;
|
|
60
|
+
SECONDARY_LIGHTEST: string;
|
|
61
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export declare const DEFAULT_BLACK_BACKGROUND = "#121212";
|
|
65
|
+
|
|
66
|
+
export declare const DEFAULT_WHITE_BACKGROUND = "#ffffff";
|
|
67
|
+
|
|
68
|
+
declare const GRAYSCALE: {
|
|
69
|
+
GRAY_SUPER_DARK: string;
|
|
70
|
+
GRAY_DARK: string;
|
|
71
|
+
GRAY_MEDIUM: string;
|
|
72
|
+
GRAY_MEDIUM_LIGHT: string;
|
|
73
|
+
GRAY_LIGHT: string;
|
|
74
|
+
GRAY_LIGHTEST: string;
|
|
75
|
+
GRAY_SUPER_LIGHT: string;
|
|
76
|
+
WHITE: string;
|
|
77
|
+
BORDER: string;
|
|
78
|
+
ELEVATION: string;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export declare const LIGHT_MODE: Palette;
|
|
82
|
+
|
|
83
|
+
export declare type Palette = {
|
|
84
|
+
BASE_COLOR: string;
|
|
85
|
+
BRAND: {
|
|
86
|
+
PRIMARY: string;
|
|
87
|
+
PRIMARY_LIGHT: string;
|
|
88
|
+
SECONDARY: string;
|
|
89
|
+
};
|
|
90
|
+
PRIMARY: {
|
|
91
|
+
PRIMARY_SUPER_DARK: string;
|
|
92
|
+
PRIMARY_DARK: string;
|
|
93
|
+
PRIMARY_MEDIUM: string;
|
|
94
|
+
PRIMARY_MEDIUM_LIGHT: string;
|
|
95
|
+
PRIMARY_LIGHT: string;
|
|
96
|
+
PRIMARY_LIGHTEST: string;
|
|
97
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
98
|
+
};
|
|
99
|
+
SECONDARY: {
|
|
100
|
+
SECONDARY_SUPER_DARK: string;
|
|
101
|
+
SECONDARY_DARK: string;
|
|
102
|
+
SECONDARY_MEDIUM: string;
|
|
103
|
+
SECONDARY_MEDIUM_LIGHT: string;
|
|
104
|
+
SECONDARY_LIGHT: string;
|
|
105
|
+
SECONDARY_LIGHTEST: string;
|
|
106
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
107
|
+
};
|
|
108
|
+
SUCCESS: {
|
|
109
|
+
SUCCESS_DARK: string;
|
|
110
|
+
SUCCESS_MEDIUM: string;
|
|
111
|
+
SUCCESS_LIGHT: string;
|
|
112
|
+
SUCCESS_SUPER_LIGHT: string;
|
|
113
|
+
};
|
|
114
|
+
WARNING: {
|
|
115
|
+
WARNING_DARK: string;
|
|
116
|
+
WARNING_MEDIUM: string;
|
|
117
|
+
WARNING_LIGHT: string;
|
|
118
|
+
WARNING_SUPER_LIGHT: string;
|
|
119
|
+
};
|
|
120
|
+
DANGER: {
|
|
121
|
+
DANGER_SUPER_DARK: string;
|
|
122
|
+
DANGER_DARK: string;
|
|
123
|
+
DANGER_MEDIUM: string;
|
|
124
|
+
DANGER_LIGHT: string;
|
|
125
|
+
DANGER_SUPER_LIGHT: string;
|
|
126
|
+
};
|
|
127
|
+
};
|
|
128
|
+
|
|
12
129
|
export declare const placements: Placement[];
|
|
13
130
|
|
|
14
|
-
|
|
131
|
+
declare const SECONDARY: {
|
|
132
|
+
SUPER_DARK: string;
|
|
133
|
+
DARK: string;
|
|
134
|
+
MEDIUM: string;
|
|
135
|
+
MEDIUM_LIGHT: string;
|
|
136
|
+
LIGHT: string;
|
|
137
|
+
LIGHTEST: string;
|
|
138
|
+
SUPER_LIGHT: string;
|
|
139
|
+
WHITE: string;
|
|
140
|
+
};
|
|
15
141
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
142
|
+
declare const SUCCESS: {
|
|
143
|
+
DARK: string;
|
|
144
|
+
MEDIUM: string;
|
|
145
|
+
LIGHT: string;
|
|
146
|
+
SUPER_LIGHT: string;
|
|
19
147
|
};
|
|
20
148
|
|
|
149
|
+
export declare type Theme = (typeof THEMES)[keyof typeof THEMES];
|
|
150
|
+
|
|
21
151
|
export declare const THEMES: {
|
|
22
152
|
readonly DARK: "dark";
|
|
153
|
+
readonly CUSTOM_DARK: "custom-dark";
|
|
23
154
|
readonly LIGHT: "light";
|
|
24
155
|
};
|
|
25
156
|
|
|
157
|
+
declare const WARNING: {
|
|
158
|
+
DARK: string;
|
|
159
|
+
MEDIUM: string;
|
|
160
|
+
LIGHT: string;
|
|
161
|
+
SUPER_LIGHT: string;
|
|
162
|
+
};
|
|
163
|
+
|
|
26
164
|
export { }
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
declare namespace ButtonGroup {
|
|
168
|
+
var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
169
|
+
}
|
package/dist/constants.es.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { c as e, b as m, a as p, D as A, L as D } from "./palettes-mcF0lNKY.mjs";
|
|
2
|
+
const t = {
|
|
3
|
+
DARK: "dark",
|
|
4
|
+
CUSTOM_DARK: "custom-dark",
|
|
5
|
+
LIGHT: "light"
|
|
6
|
+
}, o = [
|
|
4
7
|
"bottom",
|
|
5
8
|
"bottom left",
|
|
6
9
|
"bottom right",
|
|
@@ -23,11 +26,20 @@ const t = [
|
|
|
23
26
|
"end",
|
|
24
27
|
"end top",
|
|
25
28
|
"end bottom"
|
|
26
|
-
]
|
|
29
|
+
], r = {
|
|
30
|
+
SMALL: 576,
|
|
31
|
+
MEDIUM: 768,
|
|
32
|
+
LARGE: 992,
|
|
33
|
+
X_LARGE: 1200
|
|
34
|
+
};
|
|
27
35
|
export {
|
|
28
36
|
r as BREAKPOINTS,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
e as COLORS,
|
|
38
|
+
m as DARK_MODE,
|
|
39
|
+
p as DEFAULT_BLACK_BACKGROUND,
|
|
40
|
+
A as DEFAULT_WHITE_BACKGROUND,
|
|
41
|
+
D as LIGHT_MODE,
|
|
42
|
+
t as THEMES,
|
|
43
|
+
o as placements
|
|
32
44
|
};
|
|
33
45
|
//# sourceMappingURL=constants.es.js.map
|
package/dist/constants.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.es.js","sources":["../src/constants/
|
|
1
|
+
{"version":3,"file":"constants.es.js","sources":["../src/constants/index.ts"],"sourcesContent":["import { Placement } from \"react-aria\";\n\nexport * as COLORS from \"./colors\";\n\nexport * from \"./palettes\";\n\nexport const THEMES = {\n DARK: \"dark\",\n CUSTOM_DARK: \"custom-dark\",\n LIGHT: \"light\",\n} as const;\n\nexport type Theme = (typeof THEMES)[keyof typeof THEMES];\n\nexport const placements: Placement[] = [\n \"bottom\",\n \"bottom left\",\n \"bottom right\",\n \"bottom start\",\n \"bottom end\",\n \"top\",\n \"top left\",\n \"top right\",\n \"top start\",\n \"top end\",\n \"left\",\n \"left top\",\n \"left bottom\",\n \"start\",\n \"start top\",\n \"start bottom\",\n \"right\",\n \"right top\",\n \"right bottom\",\n \"end\",\n \"end top\",\n \"end bottom\",\n];\n\nexport const BREAKPOINTS = {\n SMALL: 576,\n MEDIUM: 768,\n LARGE: 992,\n X_LARGE: 1200,\n};\n\nexport type Breakpoint = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];\n"],"names":["THEMES","placements","BREAKPOINTS"],"mappings":";AAMO,MAAMA,IAAS;AAAA,EACpB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,OAAO;AACT,GAIaC,IAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAEaC,IAAc;AAAA,EACzB,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS;AACX;"}
|
package/dist/hooks.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./useBreakpoint-DA-JqOu3.js");exports.useBreakpoint=e.useBreakpoint;exports.useIsClosing=e.useIsClosing;exports.useLockBodyScroll=e.useLockBodyScroll;
|
|
2
2
|
//# sourceMappingURL=hooks.cjs.js.map
|
package/dist/hooks.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.cjs.js","sources":[
|
|
1
|
+
{"version":3,"file":"hooks.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/hooks.d.ts
CHANGED
|
@@ -11,32 +11,6 @@ declare const BREAKPOINTS: {
|
|
|
11
11
|
X_LARGE: number;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
declare type ProtonColorScale = {
|
|
15
|
-
SUPER_DARK: string;
|
|
16
|
-
DARK: string;
|
|
17
|
-
MEDIUM: string;
|
|
18
|
-
MEDIUM_LIGHT: string;
|
|
19
|
-
LIGHT: string;
|
|
20
|
-
LIGHTEST: string;
|
|
21
|
-
SUPER_LIGHT: string;
|
|
22
|
-
WHITE: string;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
declare type ProtonPalette = {
|
|
26
|
-
BASE_COLOR: string;
|
|
27
|
-
BRAND: {
|
|
28
|
-
PRIMARY: string;
|
|
29
|
-
PRIMARY_LIGHT: string;
|
|
30
|
-
PRIMARY_SUPER_LIGHT: string;
|
|
31
|
-
SECONDARY: string;
|
|
32
|
-
SECONDARY_LIGHT: string;
|
|
33
|
-
SECONDARY_SUPER_LIGHT: string;
|
|
34
|
-
};
|
|
35
|
-
PRIMARY: ProtonColorScale;
|
|
36
|
-
SECONDARY: ProtonColorScale;
|
|
37
|
-
GRAYSCALE: ProtonColorScale;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
14
|
export declare function useBreakpoint(breakpoint: Breakpoint, direction?: BreakpointDirection): boolean;
|
|
41
15
|
|
|
42
16
|
/**
|
|
@@ -71,12 +45,9 @@ declare interface UseIsClosingOptions {
|
|
|
71
45
|
*/
|
|
72
46
|
export declare function useLockBodyScroll(isActive?: boolean): void;
|
|
73
47
|
|
|
74
|
-
/**
|
|
75
|
-
* Generates a palette based on a background image or theme.
|
|
76
|
-
* @param backgroundImage - The URL of the background image to generate a palette from.
|
|
77
|
-
* @param theme - The theme to generate a palette for.
|
|
78
|
-
* @returns A Palette object containing the generated palette.
|
|
79
|
-
*/
|
|
80
|
-
export declare const usePalette: (backgroundImage: HTMLImageElement | string | null, theme: string) => ProtonPalette;
|
|
81
|
-
|
|
82
48
|
export { }
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
declare namespace ButtonGroup {
|
|
52
|
+
var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
}
|
package/dist/hooks.es.js
CHANGED
|
@@ -1,39 +1,7 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import { L as r, D as c } from "./darkTheme-DUWn6YJ-.mjs";
|
|
3
|
-
import { useState as i, useCallback as f, useEffect as u, useMemo as P } from "react";
|
|
4
|
-
import { a as p, g as E } from "./image-C8M6y5Op.mjs";
|
|
5
|
-
import { T } from "./theme-DQsfWeLo.mjs";
|
|
6
|
-
const A = (t, s) => {
|
|
7
|
-
const [a, o] = i(r), n = f(async () => {
|
|
8
|
-
if (!t) return r;
|
|
9
|
-
try {
|
|
10
|
-
const e = await p(
|
|
11
|
-
t
|
|
12
|
-
);
|
|
13
|
-
return E(e);
|
|
14
|
-
} catch (e) {
|
|
15
|
-
return console.error("Failed to generate palette:", e), r;
|
|
16
|
-
}
|
|
17
|
-
}, [t]);
|
|
18
|
-
return u(() => {
|
|
19
|
-
(async () => {
|
|
20
|
-
if (t) {
|
|
21
|
-
const l = await n();
|
|
22
|
-
o(l);
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (s === T.DARK) {
|
|
26
|
-
o(c);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
o(r);
|
|
30
|
-
})();
|
|
31
|
-
}, [t, s, n]), P(() => a, [a]);
|
|
32
|
-
};
|
|
1
|
+
import { b as a, a as e, u as r } from "./useBreakpoint-CjRyGKN-.mjs";
|
|
33
2
|
export {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
A as usePalette
|
|
3
|
+
a as useBreakpoint,
|
|
4
|
+
e as useIsClosing,
|
|
5
|
+
r as useLockBodyScroll
|
|
38
6
|
};
|
|
39
7
|
//# sourceMappingURL=hooks.es.js.map
|
package/dist/hooks.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.es.js","sources":[
|
|
1
|
+
{"version":3,"file":"hooks.es.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/icons.svg
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
-
<defs>
|
|
3
|
-
<symbol id="external-link" viewBox="0 0 512 512">
|
|
4
|
-
<path d="M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48M336 64h112v112M224 288L440 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/>
|
|
5
|
-
</symbol>
|
|
6
|
-
|
|
7
|
-
<symbol id="caret-down" viewBox="0 0 512 512">
|
|
8
|
-
<path fill="currentColor" d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/>
|
|
9
|
-
</symbol>
|
|
10
|
-
</defs>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<defs>
|
|
3
|
+
<symbol id="external-link" viewBox="0 0 512 512">
|
|
4
|
+
<path d="M384 224v184a40 40 0 01-40 40H104a40 40 0 01-40-40V168a40 40 0 0140-40h167.48M336 64h112v112M224 288L440 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="32"/>
|
|
5
|
+
</symbol>
|
|
6
|
+
|
|
7
|
+
<symbol id="caret-down" viewBox="0 0 512 512">
|
|
8
|
+
<path fill="currentColor" d="M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7L86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"/>
|
|
9
|
+
</symbol>
|
|
10
|
+
</defs>
|
|
11
11
|
</svg>
|