glassine-paper 1.0.1 → 1.1.1

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 CHANGED
@@ -17,13 +17,13 @@ CSS and some React components for Material Design 3
17
17
  | Button | o | o |
18
18
  | Slider | o | o |
19
19
  | Text Field | o | o |
20
+ | Checkbox | o | o |
21
+ | Switch | o | o |
22
+ | Radio | o | o |
20
23
  | Nav Drawer | o | o |
21
24
  | Nav Bar | o | x |
22
25
  | Nav Rail | o | x |
23
26
  | Fab | o | x |
24
- | Checkbox | o | x |
25
- | Switch | o | x |
26
- | Radio Button | o | x |
27
27
  | Divider | o | x |
28
28
  | Search | x | x |
29
29
  | Card | x | x |
@@ -37,14 +37,11 @@ CSS and some React components for Material Design 3
37
37
 
38
38
  ## Usage
39
39
 
40
- ```css
41
- @import url('https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900,900i');
42
- @import './glassine-paper-variables.css';
43
- @import './theme.css';
44
- @import './glassine-paper.min.css';
45
- ```
40
+ Download [glassine-paper.min.css](https://github.com/MichinobuMaeda/glassine-paper/blob/main/glassine-paper.min.css)
46
41
 
47
- `glassine-paper-variables.css` with default values
42
+ Get [theme.css](https://pages.michinobu.jp/glassine-paper/theme/)
43
+
44
+ Create `glassine-paper-variables.css`
48
45
 
49
46
  ```css
50
47
  :root {
@@ -66,12 +63,21 @@ CSS and some React components for Material Design 3
66
63
  }
67
64
  ```
68
65
 
66
+ Import CSS files
67
+
68
+ ```css
69
+ @import url('https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i,900,900i');
70
+ @import './glassine-paper-variables.css';
71
+ @import './theme.css';
72
+ @import './glassine-paper.min.css';
73
+ ```
74
+
69
75
  ### Installation
70
76
 
71
77
  Install from GitHub repository:
72
78
 
73
79
  ```bash
74
- npm install github:MichinobuMaeda/glassine-paper
80
+ npm i glassine-paper
75
81
  ```
76
82
 
77
83
  ### Import CSS
package/lib/AppBar.d.ts CHANGED
@@ -22,24 +22,24 @@ export interface AppBarProps {
22
22
  /**
23
23
  * Material Design 3 App bar component
24
24
  *
25
- * @param props AppBarProps
26
- * @param props.id Element id
27
- * @param props.items Array of AppBarItem configurations
28
- * @param props.items[].key Unique key for the item
29
- * @param props.items[].id Element id for the item
30
- * @param props.items[].type Item type: 'button', 'appLogo', 'title', or 'spacer'
31
- * @param props.items[].icon Icon element (svg or img)
32
- * @param props.items[].title Title text
33
- * @param props.items[].subtitle Subtitle text
34
- * @param props.items[].active Active state
35
- * @param props.items[].hidden Hidden state
36
- * @param props.items[].disabled Disabled state
37
- * @param props.items[].onClick Click handler
38
- * @param props.items[].href Link URL (renders as anchor tag)
39
- * @param props.sticky Whether the app bar sticks to the top
40
- * @param props.scrolled Whether the content is scrolled (affects styling)
41
- * @param props.style Custom inline styles
42
- * @returns JSX.Element
25
+ * @param {AppBarProps} props The props for the AppBar component.
26
+ * @param {string} [props.id] Element id
27
+ * @param {Iterable<AppBarItemProps>} props.items Array of AppBarItem configurations
28
+ * @param {(string | number)} [props.items[].key] Unique key for the item
29
+ * @param {string} [props.items[].id] Element id for the item
30
+ * @param {('button' | 'appLogo' | 'title' | 'spacer')} [props.items[].type] Item type: 'button', 'appLogo', 'title', or 'spacer'
31
+ * @param {React.ReactNode} [props.items[].icon] Icon element (svg or img)
32
+ * @param {string} [props.items[].title] Title text
33
+ * @param {string} [props.items[].subtitle] Subtitle text
34
+ * @param {boolean} [props.items[].active] Active state
35
+ * @param {boolean} [props.items[].hidden] Hidden state
36
+ * @param {boolean} [props.items[].disabled] Disabled state
37
+ * @param {Function} [props.items[].onClick] Click handler
38
+ * @param {string} [props.items[].href] Link URL (renders as anchor tag)
39
+ * @param {boolean} [props.sticky] Whether the app bar sticks to the top
40
+ * @param {boolean} [props.scrolled] Whether the content is scrolled (affects styling)
41
+ * @param {React.CSSProperties} [props.style] Custom inline styles
42
+ * @returns {JSX.Element}
43
43
  *
44
44
  * @example
45
45
  * import useDetectScroll, { Axis } from '@smakss/react-scroll-direction';
package/lib/AppBar.js CHANGED
@@ -19,24 +19,24 @@ const AppBarItem = ({ id, type = 'button', title, subtitle, icon, active = false
19
19
  /**
20
20
  * Material Design 3 App bar component
21
21
  *
22
- * @param props AppBarProps
23
- * @param props.id Element id
24
- * @param props.items Array of AppBarItem configurations
25
- * @param props.items[].key Unique key for the item
26
- * @param props.items[].id Element id for the item
27
- * @param props.items[].type Item type: 'button', 'appLogo', 'title', or 'spacer'
28
- * @param props.items[].icon Icon element (svg or img)
29
- * @param props.items[].title Title text
30
- * @param props.items[].subtitle Subtitle text
31
- * @param props.items[].active Active state
32
- * @param props.items[].hidden Hidden state
33
- * @param props.items[].disabled Disabled state
34
- * @param props.items[].onClick Click handler
35
- * @param props.items[].href Link URL (renders as anchor tag)
36
- * @param props.sticky Whether the app bar sticks to the top
37
- * @param props.scrolled Whether the content is scrolled (affects styling)
38
- * @param props.style Custom inline styles
39
- * @returns JSX.Element
22
+ * @param {AppBarProps} props The props for the AppBar component.
23
+ * @param {string} [props.id] Element id
24
+ * @param {Iterable<AppBarItemProps>} props.items Array of AppBarItem configurations
25
+ * @param {(string | number)} [props.items[].key] Unique key for the item
26
+ * @param {string} [props.items[].id] Element id for the item
27
+ * @param {('button' | 'appLogo' | 'title' | 'spacer')} [props.items[].type] Item type: 'button', 'appLogo', 'title', or 'spacer'
28
+ * @param {React.ReactNode} [props.items[].icon] Icon element (svg or img)
29
+ * @param {string} [props.items[].title] Title text
30
+ * @param {string} [props.items[].subtitle] Subtitle text
31
+ * @param {boolean} [props.items[].active] Active state
32
+ * @param {boolean} [props.items[].hidden] Hidden state
33
+ * @param {boolean} [props.items[].disabled] Disabled state
34
+ * @param {Function} [props.items[].onClick] Click handler
35
+ * @param {string} [props.items[].href] Link URL (renders as anchor tag)
36
+ * @param {boolean} [props.sticky] Whether the app bar sticks to the top
37
+ * @param {boolean} [props.scrolled] Whether the content is scrolled (affects styling)
38
+ * @param {React.CSSProperties} [props.style] Custom inline styles
39
+ * @returns {JSX.Element}
40
40
  *
41
41
  * @example
42
42
  * import useDetectScroll, { Axis } from '@smakss/react-scroll-direction';
package/lib/Button.d.ts CHANGED
@@ -22,23 +22,23 @@ export interface ButtonProps {
22
22
  /**
23
23
  * Material Design 3 Button component
24
24
  *
25
- * @param props ButtonProps
26
- * @param props.id Input id attribute
27
- * @param props.name Input name attribute
28
- * @param props.variant Button variant: 'filled', 'tonal', 'danger', 'error', 'outlined', 'elevated', or 'text'
29
- * @param props.size Button size: 'xs', 'sm', or 'md'
30
- * @param props.radius Button radius: 'default' or 'square'
31
- * @param props.label Label text
32
- * @param props.icon Leading icon element
33
- * @param props.width Icon button width: 'narrow', 'default', or 'wide'
34
- * @param props.type Button type: 'button', 'submit', 'reset', 'toggle', or 'select'
35
- * @param props.href Link URL (renders as anchor tag)
36
- * @param props.checked Checked state (for toggle/select types)
37
- * @param props.disabled Disabled state
38
- * @param props.onClick Click handler
39
- * @param props.className Additional CSS class names
40
- * @param props.style Custom inline styles
41
- * @returns JSX.Element
25
+ * @param {ButtonProps} props ButtonProps
26
+ * @param {string} [props.id] Input id attribute
27
+ * @param {string} [props.name] Input name attribute
28
+ * @param {('filled' | 'tonal' | 'danger' | 'error' | 'outlined' | 'elevated' | 'text')} [props.variant] Button variant: 'filled', 'tonal', 'danger', 'error', 'outlined', 'elevated', or 'text'
29
+ * @param {('xs' | 'sm' | 'md')} [props.size] Button size: 'xs', 'sm', or 'md'
30
+ * @param {('default' | 'square')} [props.radius] Button radius: 'default' or 'square'
31
+ * @param {string} [props.label] Label text
32
+ * @param {React.ReactNode} [props.icon] Leading icon element
33
+ * @param {('narrow' | 'default' | 'wide')} [props.width] Icon button width: 'narrow', 'default', or 'wide'
34
+ * @param {('button' | 'submit' | 'reset' | 'toggle' | 'select')} [props.type] Button type: 'button', 'submit', 'reset', 'toggle', or 'select'
35
+ * @param {string} [props.href] Link URL (renders as anchor tag)
36
+ * @param {boolean} [props.checked] Checked state (for toggle/select types)
37
+ * @param {boolean} [props.disabled] Disabled state
38
+ * @param {Function} [props.onClick] Click handler
39
+ * @param {string} [props.className] Additional CSS class names
40
+ * @param {React.CSSProperties} [props.style] Custom inline styles
41
+ * @returns {JSX.Element}
42
42
  *
43
43
  * @example
44
44
  * // Regular button
package/lib/Button.js CHANGED
@@ -3,23 +3,23 @@ import React, {} from 'react';
3
3
  /**
4
4
  * Material Design 3 Button component
5
5
  *
6
- * @param props ButtonProps
7
- * @param props.id Input id attribute
8
- * @param props.name Input name attribute
9
- * @param props.variant Button variant: 'filled', 'tonal', 'danger', 'error', 'outlined', 'elevated', or 'text'
10
- * @param props.size Button size: 'xs', 'sm', or 'md'
11
- * @param props.radius Button radius: 'default' or 'square'
12
- * @param props.label Label text
13
- * @param props.icon Leading icon element
14
- * @param props.width Icon button width: 'narrow', 'default', or 'wide'
15
- * @param props.type Button type: 'button', 'submit', 'reset', 'toggle', or 'select'
16
- * @param props.href Link URL (renders as anchor tag)
17
- * @param props.checked Checked state (for toggle/select types)
18
- * @param props.disabled Disabled state
19
- * @param props.onClick Click handler
20
- * @param props.className Additional CSS class names
21
- * @param props.style Custom inline styles
22
- * @returns JSX.Element
6
+ * @param {ButtonProps} props ButtonProps
7
+ * @param {string} [props.id] Input id attribute
8
+ * @param {string} [props.name] Input name attribute
9
+ * @param {('filled' | 'tonal' | 'danger' | 'error' | 'outlined' | 'elevated' | 'text')} [props.variant] Button variant: 'filled', 'tonal', 'danger', 'error', 'outlined', 'elevated', or 'text'
10
+ * @param {('xs' | 'sm' | 'md')} [props.size] Button size: 'xs', 'sm', or 'md'
11
+ * @param {('default' | 'square')} [props.radius] Button radius: 'default' or 'square'
12
+ * @param {string} [props.label] Label text
13
+ * @param {React.ReactNode} [props.icon] Leading icon element
14
+ * @param {('narrow' | 'default' | 'wide')} [props.width] Icon button width: 'narrow', 'default', or 'wide'
15
+ * @param {('button' | 'submit' | 'reset' | 'toggle' | 'select')} [props.type] Button type: 'button', 'submit', 'reset', 'toggle', or 'select'
16
+ * @param {string} [props.href] Link URL (renders as anchor tag)
17
+ * @param {boolean} [props.checked] Checked state (for toggle/select types)
18
+ * @param {boolean} [props.disabled] Disabled state
19
+ * @param {Function} [props.onClick] Click handler
20
+ * @param {string} [props.className] Additional CSS class names
21
+ * @param {React.CSSProperties} [props.style] Custom inline styles
22
+ * @returns {JSX.Element}
23
23
  *
24
24
  * @example
25
25
  * // Regular button
@@ -0,0 +1,41 @@
1
+ import React, { type CSSProperties } from 'react';
2
+ /**
3
+ * Checkbox component props
4
+ */
5
+ export interface CheckboxProps {
6
+ id?: string;
7
+ name?: string;
8
+ error?: boolean;
9
+ disabled?: boolean;
10
+ value?: string;
11
+ checked?: boolean;
12
+ onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
13
+ className?: string;
14
+ style?: CSSProperties;
15
+ }
16
+ /**
17
+ * Material Design 3 Checkbox component.
18
+ *
19
+ * @param {CheckboxProps} props The properties for the Checkbox component.
20
+ * @param {string} [props.id] The ID of the checkbox.
21
+ * @param {string} [props.name] The name of the checkbox.
22
+ * @param {boolean} [props.error=false] Whether the checkbox is in an error state.
23
+ * @param {boolean} [props.disabled=false] Whether the checkbox is disabled.
24
+ * @param {string} [props.value] The value of the checkbox.
25
+ * @param {boolean} [props.checked] Whether the checkbox is checked.
26
+ * @param {Function} [props.onClick] The function to call when the checkbox is clicked.
27
+ * @param {string} [props.className] Additional CSS classes to apply to the checkbox.
28
+ * @param {CSSProperties} [props.style] Additional CSS styles to apply to the checkbox.
29
+ * @returns {JSX.Element} A Checkbox component.
30
+ *
31
+ * @example
32
+ * <Checkbox
33
+ * id="my-checkbox"
34
+ * name="my-checkbox"
35
+ * checked={isChecked}
36
+ * onClick={() => setIsChecked(!isChecked)}
37
+ * />
38
+ */
39
+ export declare const Checkbox: React.FC<CheckboxProps>;
40
+ export default Checkbox;
41
+ //# sourceMappingURL=Checkbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0B5C,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, {} from 'react';
3
+ /**
4
+ * Material Design 3 Checkbox component.
5
+ *
6
+ * @param {CheckboxProps} props The properties for the Checkbox component.
7
+ * @param {string} [props.id] The ID of the checkbox.
8
+ * @param {string} [props.name] The name of the checkbox.
9
+ * @param {boolean} [props.error=false] Whether the checkbox is in an error state.
10
+ * @param {boolean} [props.disabled=false] Whether the checkbox is disabled.
11
+ * @param {string} [props.value] The value of the checkbox.
12
+ * @param {boolean} [props.checked] Whether the checkbox is checked.
13
+ * @param {Function} [props.onClick] The function to call when the checkbox is clicked.
14
+ * @param {string} [props.className] Additional CSS classes to apply to the checkbox.
15
+ * @param {CSSProperties} [props.style] Additional CSS styles to apply to the checkbox.
16
+ * @returns {JSX.Element} A Checkbox component.
17
+ *
18
+ * @example
19
+ * <Checkbox
20
+ * id="my-checkbox"
21
+ * name="my-checkbox"
22
+ * checked={isChecked}
23
+ * onClick={() => setIsChecked(!isChecked)}
24
+ * />
25
+ */
26
+ export const Checkbox = ({ id, name, error = false, disabled = false, value, checked, onClick, className = '', style = {}, }) => {
27
+ const classes = ['checkbox', error ? 'error' : '', className];
28
+ return (_jsx("input", { id: id, name: name, className: classes.join(' '), type: "checkbox", style: style, disabled: disabled, value: value, checked: checked, onClick: (event) => (onClick ? onClick(event) : undefined) }));
29
+ };
30
+ export default Checkbox;
31
+ //# sourceMappingURL=Checkbox.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Checkbox.js","sourceRoot":"","sources":["../src/components/Checkbox.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAiBlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAA4B,CAAC,EAChD,EAAE,EACF,IAAI,EACJ,KAAK,GAAG,KAAK,EACb,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,GACX,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAE9D,OAAO,CACL,gBACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAC5B,IAAI,EAAC,UAAU,EACf,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAC1D,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
package/lib/Menu.d.ts CHANGED
@@ -19,21 +19,21 @@ export interface MenuProps {
19
19
  /**
20
20
  * Material Design 3 Menu component
21
21
  *
22
- * @param props MenuProps
23
- * @param props.id Element id
24
- * @param props.items Array of MenuItem configurations
25
- * @param props.items[].key Unique key for the item
26
- * @param props.items[].id Element id for the item
27
- * @param props.items[].label Label text
28
- * @param props.items[].leadingIcon Leading icon element
29
- * @param props.items[].trailingIcon Trailing icon element
30
- * @param props.items[].divider Show as divider (renders hr element)
31
- * @param props.items[].active Active state
32
- * @param props.items[].disabled Disabled state
33
- * @param props.items[].onClick Click handler
34
- * @param props.items[].href Link URL (renders as anchor tag)
35
- * @param props.style Custom inline styles
36
- * @returns JSX.Element
22
+ * @param {MenuProps} props MenuProps
23
+ * @param {string} [props.id] Element id
24
+ * @param {Iterable<MenuItemProps>} props.items Array of MenuItem configurations
25
+ * @param {(string | number)} [props.items[].key] Unique key for the item
26
+ * @param {string} [props.items[].id] Element id for the item
27
+ * @param {string} [props.items[].label] Label text
28
+ * @param {React.ReactNode} [props.items[].leadingIcon] Leading icon element
29
+ * @param {React.ReactNode} [props.items[].trailingIcon] Trailing icon element
30
+ * @param {boolean} [props.items[].divider] Show as divider (renders hr element)
31
+ * @param {boolean} [props.items[].active] Active state
32
+ * @param {boolean} [props.items[].disabled] Disabled state
33
+ * @param {Function} [props.items[].onClick] Click handler
34
+ * @param {string} [props.items[].href] Link URL (renders as anchor tag)
35
+ * @param {React.CSSProperties} [props.style] Custom inline styles
36
+ * @returns {JSX.Element}
37
37
  *
38
38
  * @example
39
39
  * <Menu
package/lib/Menu.js CHANGED
@@ -7,21 +7,21 @@ const MenuItem = ({ key, id, label, leadingIcon, trailingIcon, divider = false,
7
7
  /**
8
8
  * Material Design 3 Menu component
9
9
  *
10
- * @param props MenuProps
11
- * @param props.id Element id
12
- * @param props.items Array of MenuItem configurations
13
- * @param props.items[].key Unique key for the item
14
- * @param props.items[].id Element id for the item
15
- * @param props.items[].label Label text
16
- * @param props.items[].leadingIcon Leading icon element
17
- * @param props.items[].trailingIcon Trailing icon element
18
- * @param props.items[].divider Show as divider (renders hr element)
19
- * @param props.items[].active Active state
20
- * @param props.items[].disabled Disabled state
21
- * @param props.items[].onClick Click handler
22
- * @param props.items[].href Link URL (renders as anchor tag)
23
- * @param props.style Custom inline styles
24
- * @returns JSX.Element
10
+ * @param {MenuProps} props MenuProps
11
+ * @param {string} [props.id] Element id
12
+ * @param {Iterable<MenuItemProps>} props.items Array of MenuItem configurations
13
+ * @param {(string | number)} [props.items[].key] Unique key for the item
14
+ * @param {string} [props.items[].id] Element id for the item
15
+ * @param {string} [props.items[].label] Label text
16
+ * @param {React.ReactNode} [props.items[].leadingIcon] Leading icon element
17
+ * @param {React.ReactNode} [props.items[].trailingIcon] Trailing icon element
18
+ * @param {boolean} [props.items[].divider] Show as divider (renders hr element)
19
+ * @param {boolean} [props.items[].active] Active state
20
+ * @param {boolean} [props.items[].disabled] Disabled state
21
+ * @param {Function} [props.items[].onClick] Click handler
22
+ * @param {string} [props.items[].href] Link URL (renders as anchor tag)
23
+ * @param {React.CSSProperties} [props.style] Custom inline styles
24
+ * @returns {JSX.Element}
25
25
  *
26
26
  * @example
27
27
  * <Menu
@@ -21,23 +21,23 @@ export interface NavDrawerProps {
21
21
  /**
22
22
  * Material Design 3 NavDrawer component
23
23
  *
24
- * @param props NavDrawerProps
25
- * @param props.id Element id
26
- * @param props.items Array of NavDrawerItem configurations
27
- * @param props.items[].key Unique key for the item
28
- * @param props.items[].id Element id for the item
29
- * @param props.items[].label Label text
30
- * @param props.items[].leadingIcon Leading icon element
31
- * @param props.items[].trailingIcon Trailing icon element
32
- * @param props.items[].divider Show as divider (renders hr element)
33
- * @param props.items[].active Active state
34
- * @param props.items[].hidden Hidden state
35
- * @param props.items[].disabled Disabled state
36
- * @param props.items[].onClick Click handler
37
- * @param props.items[].href Link URL (renders as anchor tag)
38
- * @param props.className Additional CSS class names
39
- * @param props.style Custom inline styles
40
- * @returns JSX.Element
24
+ * @param {NavDrawerProps} props NavDrawerProps
25
+ * @param {string} [props.id] Element id
26
+ * @param {Iterable<NavDrawerItemProps>} props.items Array of NavDrawerItem configurations
27
+ * @param {(string | number)} [props.items[].key] Unique key for the item
28
+ * @param {string} [props.items[].id] Element id for the item
29
+ * @param {string} [props.items[].label] Label text
30
+ * @param {React.ReactNode} [props.items[].leadingIcon] Leading icon element
31
+ * @param {React.ReactNode} [props.items[].trailingIcon] Trailing icon element
32
+ * @param {boolean} [props.items[].divider] Show as divider (renders hr element)
33
+ * @param {boolean} [props.items[].active] Active state
34
+ * @param {boolean} [props.items[].hidden] Hidden state
35
+ * @param {boolean} [props.items[].disabled] Disabled state
36
+ * @param {Function} [props.items[].onClick] Click handler
37
+ * @param {string} [props.items[].href] Link URL (renders as anchor tag)
38
+ * @param {string} [props.className] Additional CSS class names
39
+ * @param {React.CSSProperties} [props.style] Custom inline styles
40
+ * @returns {JSX.Element}
41
41
  *
42
42
  * @example
43
43
  * <NavDrawer
package/lib/NavDrawer.js CHANGED
@@ -11,23 +11,23 @@ const NavDrawerItem = ({ key, id, label, leadingIcon, trailingIcon, divider = fa
11
11
  /**
12
12
  * Material Design 3 NavDrawer component
13
13
  *
14
- * @param props NavDrawerProps
15
- * @param props.id Element id
16
- * @param props.items Array of NavDrawerItem configurations
17
- * @param props.items[].key Unique key for the item
18
- * @param props.items[].id Element id for the item
19
- * @param props.items[].label Label text
20
- * @param props.items[].leadingIcon Leading icon element
21
- * @param props.items[].trailingIcon Trailing icon element
22
- * @param props.items[].divider Show as divider (renders hr element)
23
- * @param props.items[].active Active state
24
- * @param props.items[].hidden Hidden state
25
- * @param props.items[].disabled Disabled state
26
- * @param props.items[].onClick Click handler
27
- * @param props.items[].href Link URL (renders as anchor tag)
28
- * @param props.className Additional CSS class names
29
- * @param props.style Custom inline styles
30
- * @returns JSX.Element
14
+ * @param {NavDrawerProps} props NavDrawerProps
15
+ * @param {string} [props.id] Element id
16
+ * @param {Iterable<NavDrawerItemProps>} props.items Array of NavDrawerItem configurations
17
+ * @param {(string | number)} [props.items[].key] Unique key for the item
18
+ * @param {string} [props.items[].id] Element id for the item
19
+ * @param {string} [props.items[].label] Label text
20
+ * @param {React.ReactNode} [props.items[].leadingIcon] Leading icon element
21
+ * @param {React.ReactNode} [props.items[].trailingIcon] Trailing icon element
22
+ * @param {boolean} [props.items[].divider] Show as divider (renders hr element)
23
+ * @param {boolean} [props.items[].active] Active state
24
+ * @param {boolean} [props.items[].hidden] Hidden state
25
+ * @param {boolean} [props.items[].disabled] Disabled state
26
+ * @param {Function} [props.items[].onClick] Click handler
27
+ * @param {string} [props.items[].href] Link URL (renders as anchor tag)
28
+ * @param {string} [props.className] Additional CSS class names
29
+ * @param {React.CSSProperties} [props.style] Custom inline styles
30
+ * @returns {JSX.Element}
31
31
  *
32
32
  * @example
33
33
  * <NavDrawer
package/lib/Radio.d.ts ADDED
@@ -0,0 +1,40 @@
1
+ import React, { type CSSProperties } from 'react';
2
+ /**
3
+ * Radio component props
4
+ */
5
+ export interface RadioProps {
6
+ id?: string;
7
+ name?: string;
8
+ disabled?: boolean;
9
+ value?: string;
10
+ checked?: boolean;
11
+ onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
12
+ className?: string;
13
+ style?: CSSProperties;
14
+ }
15
+ /**
16
+ * Material Design 3 Radio button component.
17
+ *
18
+ * @param {RadioProps} props The properties for the Radio component.
19
+ * @param {string} [props.id] The ID of the radio button.
20
+ * @param {string} [props.name] The name of the radio button.
21
+ * @param {boolean} [props.disabled=false] Whether the radio button is disabled.
22
+ * @param {string} [props.value] The value of the radio button.
23
+ * @param {boolean} [props.checked] Whether the radio button is checked.
24
+ * @param {Function} [props.onClick] The function to call when the radio button is clicked.
25
+ * @param {string} [props.className] Additional CSS classes to apply to the radio button.
26
+ * @param {CSSProperties} [props.style] Additional CSS styles to apply to the radio button.
27
+ * @returns {JSX.Element} A Radio component.
28
+ *
29
+ * @example
30
+ * <Radio
31
+ * id="my-radio"
32
+ * name="my-radio-group"
33
+ * value="option1"
34
+ * checked={selectedValue === 'option1'}
35
+ * onClick={() => setSelectedValue('option1')}
36
+ * />
37
+ */
38
+ export declare const Radio: React.FC<RadioProps>;
39
+ export default Radio;
40
+ //# sourceMappingURL=Radio.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../src/components/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAElD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAyBtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/lib/Radio.js ADDED
@@ -0,0 +1,31 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, {} from 'react';
3
+ /**
4
+ * Material Design 3 Radio button component.
5
+ *
6
+ * @param {RadioProps} props The properties for the Radio component.
7
+ * @param {string} [props.id] The ID of the radio button.
8
+ * @param {string} [props.name] The name of the radio button.
9
+ * @param {boolean} [props.disabled=false] Whether the radio button is disabled.
10
+ * @param {string} [props.value] The value of the radio button.
11
+ * @param {boolean} [props.checked] Whether the radio button is checked.
12
+ * @param {Function} [props.onClick] The function to call when the radio button is clicked.
13
+ * @param {string} [props.className] Additional CSS classes to apply to the radio button.
14
+ * @param {CSSProperties} [props.style] Additional CSS styles to apply to the radio button.
15
+ * @returns {JSX.Element} A Radio component.
16
+ *
17
+ * @example
18
+ * <Radio
19
+ * id="my-radio"
20
+ * name="my-radio-group"
21
+ * value="option1"
22
+ * checked={selectedValue === 'option1'}
23
+ * onClick={() => setSelectedValue('option1')}
24
+ * />
25
+ */
26
+ export const Radio = ({ id, name, disabled = false, value, checked, onClick, className = '', style = {}, }) => {
27
+ const classes = ['radio', className];
28
+ return (_jsx("input", { id: id, name: name, className: classes.join(' '), type: "radio", style: style, disabled: disabled, value: value, checked: checked, onClick: (event) => (onClick ? onClick(event) : undefined) }));
29
+ };
30
+ export default Radio;
31
+ //# sourceMappingURL=Radio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Radio.js","sourceRoot":"","sources":["../src/components/Radio.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,EAAsB,MAAM,OAAO,CAAC;AAgBlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,KAAK,GAAyB,CAAC,EAC1C,EAAE,EACF,IAAI,EACJ,QAAQ,GAAG,KAAK,EAChB,KAAK,EACL,OAAO,EACP,OAAO,EACP,SAAS,GAAG,EAAE,EACd,KAAK,GAAG,EAAE,GACX,EAAE,EAAE;IACH,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAErC,OAAO,CACL,gBACE,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAC5B,IAAI,EAAC,OAAO,EACZ,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,GAC1D,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/lib/Slider.d.ts CHANGED
@@ -21,23 +21,23 @@ export interface SliderProps {
21
21
  /**
22
22
  * Material Design 3 Slider component
23
23
  *
24
- * @param props SliderProps
25
- * @param props.id Input id attribute
26
- * @param props.name Input name attribute
27
- * @param props.min Minimum value
28
- * @param props.max Maximum value
29
- * @param props.step Step increment
30
- * @param props.value Current value
31
- * @param props.size Size variant: 'xs', 'sm', or 'md'
32
- * @param props.orientation Orientation: 'horizontal', 'top-bottom', or 'bottom-top'
33
- * @param props.showValueIndicator Show value indicator
34
- * @param props.options Datalist options array
35
- * @param props.options[].value Option value
36
- * @param props.options[].key Optional unique key for the option
37
- * @param props.onChange Change handler function
38
- * @param props.className Additional CSS class names
39
- * @param props.style Custom inline styles
40
- * @returns JSX.Element
24
+ * @param {SliderProps} props SliderProps
25
+ * @param {string} [props.id] Input id attribute
26
+ * @param {string} [props.name] Input name attribute
27
+ * @param {number} [props.min] Minimum value
28
+ * @param {number} [props.max] Maximum value
29
+ * @param {number} [props.step] Step increment
30
+ * @param {number} props.value Current value
31
+ * @param {('xs' | 'sm' | 'md')} [props.size] Size variant: 'xs', 'sm', or 'md'
32
+ * @param {('horizontal' | 'top-bottom' | 'bottom-top')} [props.orientation] Orientation: 'horizontal', 'top-bottom', or 'bottom-top'
33
+ * @param {boolean} [props.showValueIndicator] Show value indicator
34
+ * @param {SliderOption[]} [props.options] Datalist options array
35
+ * @param {number} props.options[].value Option value
36
+ * @param {string} [props.options[].key] Optional unique key for the option
37
+ * @param {Function} [props.onChange] Change handler function
38
+ * @param {string} [props.className] Additional CSS class names
39
+ * @param {React.CSSProperties} [props.style] Custom inline styles
40
+ * @returns {JSX.Element}
41
41
  *
42
42
  * @example
43
43
  * <Slider