@protonradio/proton-ui 0.11.0-beta.19 → 0.11.0-beta.20
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 +35 -115
- package/dist/constants.cjs.js +1 -1
- package/dist/constants.cjs.js.map +1 -1
- package/dist/constants.d.ts +149 -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/index.cjs.js +12 -12
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +353 -483
- package/dist/index.es.js +11614 -10122
- package/dist/index.es.js.map +1 -1
- package/dist/palettes-D006-kxf.mjs +174 -0
- package/dist/palettes-D006-kxf.mjs.map +1 -0
- package/dist/palettes-DfloGKJz.js +2 -0
- package/dist/palettes-DfloGKJz.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/utils.cjs.js +1 -1
- package/dist/utils.cjs.js.map +1 -1
- package/dist/utils.d.ts +45 -26
- package/dist/utils.es.js +457 -17
- package/dist/utils.es.js.map +1 -1
- package/package.json +4 -8
- 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,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Proton UI
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
@@ -6,148 +6,68 @@
|
|
|
6
6
|
npm run storybook
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
### Publishing Updates to NPM
|
|
10
10
|
|
|
11
|
-
### Prerequisites
|
|
12
|
-
|
|
13
|
-
1. Ensure you have access to `@protonradio/proton-ui` [npm package](https://www.npmjs.com/package/@protonradio/proton-ui)
|
|
14
|
-
2. Login using `npm login`
|
|
15
|
-
|
|
16
|
-
### Install
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
npm install @protonradio/proton-ui --save
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
### Import Styles
|
|
23
|
-
|
|
24
|
-
Import the styles into your main CSS file:
|
|
25
|
-
|
|
26
|
-
```css
|
|
27
|
-
@import "@protonradio/proton-ui/styles";
|
|
28
11
|
```
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
Wrap your application with the `ThemeProvider` to enable theming:
|
|
33
|
-
|
|
34
|
-
```jsx
|
|
35
|
-
import { ThemeProvider, THEMES } from "@protonradio/proton-ui";
|
|
36
|
-
|
|
37
|
-
function MyApp({ Component, pageProps }) {
|
|
38
|
-
return (
|
|
39
|
-
<ThemeProvider theme={THEMES.DARK}>
|
|
40
|
-
<Component {...pageProps} />
|
|
41
|
-
</ThemeProvider>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
12
|
+
npm run build
|
|
13
|
+
npm version <new_version> // increment version in package.json accordingly using semver
|
|
14
|
+
npm publish
|
|
44
15
|
```
|
|
45
16
|
|
|
46
|
-
###
|
|
47
|
-
|
|
48
|
-
Each theme has a `ProtonPalette` with colors tailored for UI design. Palettes are made up of `ProtonColorScale`s that have shades from super_light to super_dark:
|
|
17
|
+
### Themes
|
|
49
18
|
|
|
50
|
-
|
|
51
|
-
- **Secondary Scale**
|
|
52
|
-
- **Brand Colors** [Partial ProtonColorScale]
|
|
53
|
-
- **Gray Scale**
|
|
54
|
-
- **Semantic Colors**
|
|
55
|
-
- Success
|
|
56
|
-
- Warning
|
|
57
|
-
- Error
|
|
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.
|
|
58
20
|
|
|
59
|
-
|
|
21
|
+
#### Adding a Theme
|
|
60
22
|
|
|
61
|
-
To
|
|
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]`.
|
|
62
24
|
|
|
63
|
-
|
|
64
|
-
import { ThemeProvider, usePalette, THEMES } from "@protonradio/proton-ui";
|
|
25
|
+
#### Styling for a theme
|
|
65
26
|
|
|
66
|
-
function
|
|
67
|
-
const customPalette = usePalette(
|
|
68
|
-
`https://example.com/${props.imgUrl}.jpg`,
|
|
69
|
-
THEMES.DARK
|
|
70
|
-
);
|
|
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.
|
|
71
28
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
);
|
|
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;
|
|
77
33
|
}
|
|
78
34
|
```
|
|
79
35
|
|
|
80
|
-
|
|
36
|
+
### Implementing in your application
|
|
81
37
|
|
|
82
|
-
|
|
38
|
+
#### Prerequisites
|
|
83
39
|
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
```
|
|
40
|
+
1. Ensure you have access to Proton's `proton-ui` npm package
|
|
41
|
+
2. Login to npm using `npm login`
|
|
94
42
|
|
|
95
|
-
|
|
43
|
+
#### Install
|
|
96
44
|
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
background-color: var(--proton-control__background-color);
|
|
100
|
-
}
|
|
45
|
+
```
|
|
46
|
+
npm install @protonradio/proton-ui --save
|
|
101
47
|
```
|
|
102
48
|
|
|
103
|
-
|
|
49
|
+
#### Import the styles
|
|
50
|
+
Then import the styles into your main.css file.
|
|
104
51
|
|
|
105
52
|
```css
|
|
106
|
-
|
|
107
|
-
background-color: var(--proton-control__interactive-color);
|
|
108
|
-
}
|
|
53
|
+
@import "@protonradio/proton-ui/styles";
|
|
109
54
|
```
|
|
110
55
|
|
|
111
|
-
|
|
112
|
-
|
|
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.
|
|
113
58
|
|
|
114
59
|
```jsx
|
|
115
|
-
import {
|
|
116
|
-
|
|
117
|
-
function MyComponent() {
|
|
118
|
-
const { palette } = useTheme();
|
|
60
|
+
import { ThemeProvider, THEMES } from "@protonradio/proton-ui";
|
|
119
61
|
|
|
120
|
-
|
|
121
|
-
return
|
|
62
|
+
function MyApp({ Component, pageProps }) {
|
|
63
|
+
return (
|
|
64
|
+
<ThemeProvider theme={THEMES.DARK}>
|
|
65
|
+
<Component {...pageProps} />
|
|
66
|
+
</ThemeProvider>
|
|
67
|
+
);
|
|
122
68
|
}
|
|
123
69
|
```
|
|
124
70
|
|
|
125
|
-
|
|
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
|
|
71
|
+
### Recommended Reading
|
|
152
72
|
|
|
153
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-DfloGKJz.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\";\r\n\r\nexport * as COLORS from \"./colors\";\r\n\r\nexport * from \"./palettes\";\r\n\r\nexport const THEMES = {\r\n DARK: \"dark\",\r\n CUSTOM_DARK: \"custom-dark\",\r\n LIGHT: \"light\",\r\n} as const;\r\n\r\nexport type Theme = (typeof THEMES)[keyof typeof THEMES];\r\n\r\nexport const placements: Placement[] = [\r\n \"bottom\",\r\n \"bottom left\",\r\n \"bottom right\",\r\n \"bottom start\",\r\n \"bottom end\",\r\n \"top\",\r\n \"top left\",\r\n \"top right\",\r\n \"top start\",\r\n \"top end\",\r\n \"left\",\r\n \"left top\",\r\n \"left bottom\",\r\n \"start\",\r\n \"start top\",\r\n \"start bottom\",\r\n \"right\",\r\n \"right top\",\r\n \"right bottom\",\r\n \"end\",\r\n \"end top\",\r\n \"end bottom\",\r\n];\r\n\r\nexport const BREAKPOINTS = {\r\n SMALL: 576,\r\n MEDIUM: 768,\r\n LARGE: 992,\r\n X_LARGE: 1200,\r\n};\r\n\r\nexport type Breakpoint = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];\r\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,12 @@
|
|
|
1
1
|
import { Placement } from 'react-aria';
|
|
2
2
|
|
|
3
|
+
declare const BRAND: {
|
|
4
|
+
PRIMARY: string;
|
|
5
|
+
PRIMARY_LIGHT: string;
|
|
6
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
7
|
+
SECONDARY: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
3
10
|
export declare type Breakpoint = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];
|
|
4
11
|
|
|
5
12
|
export declare const BREAKPOINTS: {
|
|
@@ -9,18 +16,156 @@ export declare const BREAKPOINTS: {
|
|
|
9
16
|
X_LARGE: number;
|
|
10
17
|
};
|
|
11
18
|
|
|
19
|
+
export declare namespace COLORS {
|
|
20
|
+
export {
|
|
21
|
+
BRAND,
|
|
22
|
+
DANGER,
|
|
23
|
+
WARNING,
|
|
24
|
+
SUCCESS,
|
|
25
|
+
GRAYSCALE,
|
|
26
|
+
SECONDARY,
|
|
27
|
+
DARK_GRAYSCALE,
|
|
28
|
+
DARK_SECONDARY
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare const DANGER: {
|
|
33
|
+
SUPER_DARK: string;
|
|
34
|
+
DARK: string;
|
|
35
|
+
MEDIUM: string;
|
|
36
|
+
LIGHT: string;
|
|
37
|
+
SUPER_LIGHT: string;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
declare const DARK_GRAYSCALE: {
|
|
41
|
+
GRAY_SUPER_DARK: string;
|
|
42
|
+
GRAY_DARK: string;
|
|
43
|
+
GRAY_MEDIUM: string;
|
|
44
|
+
GRAY_MEDIUM_LIGHT: string;
|
|
45
|
+
GRAY_LIGHT: string;
|
|
46
|
+
GRAY_LIGHTEST: string;
|
|
47
|
+
GRAY_SUPER_LIGHT: string;
|
|
48
|
+
WHITE: string;
|
|
49
|
+
BORDER: string;
|
|
50
|
+
ELEVATION: string;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export declare const DARK_MODE: Palette;
|
|
54
|
+
|
|
55
|
+
declare const DARK_SECONDARY: {
|
|
56
|
+
SECONDARY_SUPER_DARK: string;
|
|
57
|
+
SECONDARY_DARK: string;
|
|
58
|
+
SECONDARY_MEDIUM: string;
|
|
59
|
+
SECONDARY_MEDIUM_LIGHT: string;
|
|
60
|
+
SECONDARY_LIGHT: string;
|
|
61
|
+
SECONDARY_LIGHTEST: string;
|
|
62
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export declare const DEFAULT_BLACK_BACKGROUND = "#121212";
|
|
66
|
+
|
|
67
|
+
export declare const DEFAULT_WHITE_BACKGROUND = "#ffffff";
|
|
68
|
+
|
|
69
|
+
declare const GRAYSCALE: {
|
|
70
|
+
GRAY_SUPER_DARK: string;
|
|
71
|
+
GRAY_DARK: string;
|
|
72
|
+
GRAY_MEDIUM: string;
|
|
73
|
+
GRAY_MEDIUM_LIGHT: string;
|
|
74
|
+
GRAY_LIGHT: string;
|
|
75
|
+
GRAY_LIGHTEST: string;
|
|
76
|
+
GRAY_SUPER_LIGHT: string;
|
|
77
|
+
WHITE: string;
|
|
78
|
+
BORDER: string;
|
|
79
|
+
ELEVATION: string;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export declare const LIGHT_MODE: Palette;
|
|
83
|
+
|
|
84
|
+
export declare type Palette = {
|
|
85
|
+
BASE_COLOR: string;
|
|
86
|
+
BRAND: {
|
|
87
|
+
PRIMARY: string;
|
|
88
|
+
PRIMARY_LIGHT: string;
|
|
89
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
90
|
+
SECONDARY: string;
|
|
91
|
+
};
|
|
92
|
+
PRIMARY: {
|
|
93
|
+
PRIMARY_SUPER_DARK: string;
|
|
94
|
+
PRIMARY_DARK: string;
|
|
95
|
+
PRIMARY_MEDIUM: string;
|
|
96
|
+
PRIMARY_MEDIUM_LIGHT: string;
|
|
97
|
+
PRIMARY_LIGHT: string;
|
|
98
|
+
PRIMARY_LIGHTEST: string;
|
|
99
|
+
PRIMARY_SUPER_LIGHT: string;
|
|
100
|
+
};
|
|
101
|
+
SECONDARY: {
|
|
102
|
+
SECONDARY_SUPER_DARK: string;
|
|
103
|
+
SECONDARY_DARK: string;
|
|
104
|
+
SECONDARY_MEDIUM: string;
|
|
105
|
+
SECONDARY_MEDIUM_LIGHT: string;
|
|
106
|
+
SECONDARY_LIGHT: string;
|
|
107
|
+
SECONDARY_LIGHTEST: string;
|
|
108
|
+
SECONDARY_SUPER_LIGHT: string;
|
|
109
|
+
};
|
|
110
|
+
SUCCESS: {
|
|
111
|
+
SUCCESS_DARK: string;
|
|
112
|
+
SUCCESS_MEDIUM: string;
|
|
113
|
+
SUCCESS_LIGHT: string;
|
|
114
|
+
SUCCESS_SUPER_LIGHT: string;
|
|
115
|
+
};
|
|
116
|
+
WARNING: {
|
|
117
|
+
WARNING_DARK: string;
|
|
118
|
+
WARNING_MEDIUM: string;
|
|
119
|
+
WARNING_LIGHT: string;
|
|
120
|
+
WARNING_SUPER_LIGHT: string;
|
|
121
|
+
};
|
|
122
|
+
DANGER: {
|
|
123
|
+
DANGER_SUPER_DARK: string;
|
|
124
|
+
DANGER_DARK: string;
|
|
125
|
+
DANGER_MEDIUM: string;
|
|
126
|
+
DANGER_LIGHT: string;
|
|
127
|
+
DANGER_SUPER_LIGHT: string;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
|
|
12
131
|
export declare const placements: Placement[];
|
|
13
132
|
|
|
14
|
-
|
|
133
|
+
declare const SECONDARY: {
|
|
134
|
+
SUPER_DARK: string;
|
|
135
|
+
DARK: string;
|
|
136
|
+
MEDIUM: string;
|
|
137
|
+
MEDIUM_LIGHT: string;
|
|
138
|
+
LIGHT: string;
|
|
139
|
+
LIGHTEST: string;
|
|
140
|
+
SUPER_LIGHT: string;
|
|
141
|
+
WHITE: string;
|
|
142
|
+
};
|
|
15
143
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
144
|
+
declare const SUCCESS: {
|
|
145
|
+
DARK: string;
|
|
146
|
+
MEDIUM: string;
|
|
147
|
+
LIGHT: string;
|
|
148
|
+
SUPER_LIGHT: string;
|
|
19
149
|
};
|
|
20
150
|
|
|
151
|
+
export declare type Theme = (typeof THEMES)[keyof typeof THEMES];
|
|
152
|
+
|
|
21
153
|
export declare const THEMES: {
|
|
22
154
|
readonly DARK: "dark";
|
|
155
|
+
readonly CUSTOM_DARK: "custom-dark";
|
|
23
156
|
readonly LIGHT: "light";
|
|
24
157
|
};
|
|
25
158
|
|
|
159
|
+
declare const WARNING: {
|
|
160
|
+
DARK: string;
|
|
161
|
+
MEDIUM: string;
|
|
162
|
+
LIGHT: string;
|
|
163
|
+
SUPER_LIGHT: string;
|
|
164
|
+
};
|
|
165
|
+
|
|
26
166
|
export { }
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
declare namespace ButtonGroup {
|
|
170
|
+
var Option: (props: ButtonGroupOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
171
|
+
}
|
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-D006-kxf.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\";\r\n\r\nexport * as COLORS from \"./colors\";\r\n\r\nexport * from \"./palettes\";\r\n\r\nexport const THEMES = {\r\n DARK: \"dark\",\r\n CUSTOM_DARK: \"custom-dark\",\r\n LIGHT: \"light\",\r\n} as const;\r\n\r\nexport type Theme = (typeof THEMES)[keyof typeof THEMES];\r\n\r\nexport const placements: Placement[] = [\r\n \"bottom\",\r\n \"bottom left\",\r\n \"bottom right\",\r\n \"bottom start\",\r\n \"bottom end\",\r\n \"top\",\r\n \"top left\",\r\n \"top right\",\r\n \"top start\",\r\n \"top end\",\r\n \"left\",\r\n \"left top\",\r\n \"left bottom\",\r\n \"start\",\r\n \"start top\",\r\n \"start bottom\",\r\n \"right\",\r\n \"right top\",\r\n \"right bottom\",\r\n \"end\",\r\n \"end top\",\r\n \"end bottom\",\r\n];\r\n\r\nexport const BREAKPOINTS = {\r\n SMALL: 576,\r\n MEDIUM: 768,\r\n LARGE: 992,\r\n X_LARGE: 1200,\r\n};\r\n\r\nexport type Breakpoint = (typeof BREAKPOINTS)[keyof typeof BREAKPOINTS];\r\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":";"}
|