@protonradio/proton-ui 0.1.31 → 0.1.33
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 +41 -0
- package/dist/proton-ui.es.d.ts +28 -0
- package/dist/proton-ui.es.js +5048 -1354
- package/dist/proton-ui.es.js.map +1 -1
- package/dist/proton-ui.umd.js +10 -10
- package/dist/proton-ui.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,3 +5,44 @@
|
|
|
5
5
|
```
|
|
6
6
|
npm run storybook
|
|
7
7
|
```
|
|
8
|
+
|
|
9
|
+
### Publishing Updates to NPM
|
|
10
|
+
```
|
|
11
|
+
npm run build
|
|
12
|
+
npm version <new_version> // increment version in package.json accordingly using semver
|
|
13
|
+
npm publish
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### Themes
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
#### Adding a Theme
|
|
20
|
+
The current supported themes can be found in the `src/themes/config.ts`. To add a new theme, create a new attribute on the `THEME_CONFIG` object following the pattern `[themeName]: [themeClassName]`.
|
|
21
|
+
|
|
22
|
+
When applying to a project, you can import available themes using `THEME_CONFIG` from this library and apply the theme an outer div on the application. See below for an example.
|
|
23
|
+
|
|
24
|
+
```jsx
|
|
25
|
+
import { THEME_CONFIG } from '@protonradio/proton-ui'
|
|
26
|
+
|
|
27
|
+
function MyApp({ Component, pageProps }) {
|
|
28
|
+
return (
|
|
29
|
+
<div className={THEME_CONFIG.ReleaseLinks}> {/* Set your theme here */}
|
|
30
|
+
<Component {...pageProps} />
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
#### Styling for a theme
|
|
37
|
+
To apply theme specific styles in a component, you can select using the class name that belongs to the theme (see `src/themes/config.ts`). For example, to apply a style to the `ReleaseLinks` theme, you can use the following css.
|
|
38
|
+
|
|
39
|
+
Theme specific css should be placed in the `src/themes` directory in a unqiue file for the theme and component. The file naming convention should be `[componentName].[themeClassName].css`.
|
|
40
|
+
|
|
41
|
+
```css
|
|
42
|
+
.ReleaseLinks .myComponent {
|
|
43
|
+
background-color: red;
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Recommended Reading
|
|
48
|
+
- https://www.gabe.pizza/notes-on-component-libraries/
|
package/dist/proton-ui.es.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import { ColumnProps } from '@react-stately/table';
|
|
1
2
|
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
3
|
import { PressEvent } from 'react-aria';
|
|
4
|
+
import { Row } from '@react-stately/table';
|
|
5
|
+
import { Section } from '@react-stately/table';
|
|
6
|
+
import { TableBody } from '@react-stately/table';
|
|
7
|
+
import { TableHeader } from '@react-stately/table';
|
|
3
8
|
|
|
4
9
|
export declare function Button(props: ButtonProps): JSX_2.Element;
|
|
5
10
|
|
|
@@ -70,6 +75,10 @@ declare interface ButtonProps {
|
|
|
70
75
|
children?: React.ReactNode;
|
|
71
76
|
}
|
|
72
77
|
|
|
78
|
+
export declare const Cell: <T>(props: ProtonColumnProps<T>) => JSX_2.Element;
|
|
79
|
+
|
|
80
|
+
export declare const Column: <T>(props: ProtonColumnProps<T>) => JSX_2.Element;
|
|
81
|
+
|
|
73
82
|
export declare function Icon(props: IconProps): JSX_2.Element;
|
|
74
83
|
|
|
75
84
|
declare type IconID = "external-link";
|
|
@@ -89,6 +98,14 @@ declare interface IconProps {
|
|
|
89
98
|
color?: string;
|
|
90
99
|
}
|
|
91
100
|
|
|
101
|
+
export declare interface ProtonColumnProps<T> extends ColumnProps<T> {
|
|
102
|
+
align?: "left" | "center" | "right";
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export { Row }
|
|
106
|
+
|
|
107
|
+
export { Section }
|
|
108
|
+
|
|
92
109
|
export declare function Switch(props: SwitchProps): JSX_2.Element;
|
|
93
110
|
|
|
94
111
|
export declare namespace Switch {
|
|
@@ -126,4 +143,15 @@ declare interface SwitchProps {
|
|
|
126
143
|
children?: React.ReactNode;
|
|
127
144
|
}
|
|
128
145
|
|
|
146
|
+
export declare function Table(props: any): JSX_2.Element;
|
|
147
|
+
|
|
148
|
+
export { TableBody }
|
|
149
|
+
|
|
150
|
+
export { TableHeader }
|
|
151
|
+
|
|
152
|
+
export declare const THEME_CONFIG: {
|
|
153
|
+
readonly ReleaseLinks: "rl-theme";
|
|
154
|
+
readonly ProtonRadio: "client-theme";
|
|
155
|
+
};
|
|
156
|
+
|
|
129
157
|
export { }
|