@newtonedev/components 0.1.6 → 0.1.7
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/dist/index.cjs +243 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +243 -24
- package/dist/index.js.map +1 -1
- package/dist/primitives/Icon/Icon.d.ts +1 -1
- package/dist/primitives/Icon/Icon.d.ts.map +1 -1
- package/dist/primitives/Icon/Icon.types.d.ts +7 -12
- package/dist/primitives/Icon/Icon.types.d.ts.map +1 -1
- package/dist/registry/icons.d.ts +7 -0
- package/dist/registry/icons.d.ts.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/types.d.ts +1 -1
- package/dist/registry/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/primitives/Icon/Icon.tsx +4 -6
- package/src/primitives/Icon/Icon.types.ts +7 -14
- package/src/registry/icons.ts +111 -0
- package/src/registry/index.ts +3 -0
- package/src/registry/registry.ts +12 -17
- package/src/registry/types.ts +1 -1
|
@@ -13,5 +13,5 @@ import type { IconProps } from './Icon.types';
|
|
|
13
13
|
* <Icon name="check" color="#00ff00" />
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
|
-
export declare function Icon({ name, size, opticalSize, fill, color,
|
|
16
|
+
export declare function Icon({ name, size, opticalSize, fill, color, style, accessibilityLabel, testID, nativeID, ref, }: IconProps): React.JSX.Element;
|
|
17
17
|
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,IAAQ,EACR,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkB,MAAM,OAAO,CAAC;AAIvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C;;;;;;;;;;;;GAYG;AACH,wBAAgB,IAAI,CAAC,EACnB,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,IAAQ,EACR,KAAK,EACL,KAAK,EAEL,kBAAkB,EAElB,MAAM,EACN,QAAQ,EACR,GAAG,GACJ,EAAE,SAAS,qBAqEX"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import type { Text as RNText, TextStyle } from 'react-native';
|
|
2
|
-
import type { ElevationLevel } from '../../theme/types';
|
|
3
2
|
/**
|
|
4
3
|
* Props for Icon — Material Symbols icon with variable font support.
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* Icon is a pure presentation primitive. It inherits elevation from the
|
|
6
|
+
* nearest parent Frame via FrameContext. For interactive icons, wrap in
|
|
7
|
+
* `<Button icon="..." />` instead.
|
|
8
8
|
*
|
|
9
9
|
* @example
|
|
10
10
|
* ```tsx
|
|
11
11
|
* <Icon name="home" />
|
|
12
12
|
* <Icon name="settings" size={24} fill={1} />
|
|
13
13
|
* <Icon name="check" color="#00ff00" />
|
|
14
|
-
* <Icon name="delete" size={20} onPress={() => handleDelete()} />
|
|
15
14
|
* ```
|
|
16
15
|
*
|
|
17
16
|
* @see {@link https://fonts.google.com/icons Material Symbols icon reference}
|
|
@@ -31,18 +30,14 @@ export interface IconProps {
|
|
|
31
30
|
/**
|
|
32
31
|
* Fill state for the icon.
|
|
33
32
|
*
|
|
34
|
-
* - `0` — Outlined (default)
|
|
35
|
-
* - `1` — Filled (solid)
|
|
33
|
+
* - `false` / `0` — Outlined (default)
|
|
34
|
+
* - `true` / `1` — Filled (solid)
|
|
36
35
|
*/
|
|
37
|
-
readonly fill?: 0 | 1;
|
|
36
|
+
readonly fill?: boolean | 0 | 1;
|
|
38
37
|
/** Icon color as hex string. @default tokens.textPrimary */
|
|
39
38
|
readonly color?: string;
|
|
40
|
-
/**
|
|
41
|
-
readonly elevation?: ElevationLevel;
|
|
42
|
-
/** Additional styles applied to the icon Text element. */
|
|
39
|
+
/** Additional styles applied to the icon Text element (positioning, transforms). */
|
|
43
40
|
readonly style?: TextStyle;
|
|
44
|
-
/** Press handler — makes the icon tappable. */
|
|
45
|
-
readonly onPress?: () => void;
|
|
46
41
|
/** Label read by screen readers. When omitted, the icon is treated as decorative (hidden from assistive technology). */
|
|
47
42
|
readonly accessibilityLabel?: string;
|
|
48
43
|
/** Test identifier — maps to `data-testid` on web. Used by testing libraries. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon/Icon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"Icon.types.d.ts","sourceRoot":"","sources":["../../../src/primitives/Icon/Icon.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,IAAI,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,SAAS;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,uHAAuH;IACvH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IAEhC,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,oFAAoF;IACpF,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAI3B,wHAAwH;IACxH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAIrC,iFAAiF;IACjF,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEzB,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAE3B,0CAA0C;IAC1C,QAAQ,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/registry/icons.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CACnC;AAED,eAAO,MAAM,YAAY,EAAE,SAAS,mBAAmB,EAwGtD,CAAC"}
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type { CategoryMeta, VariantMeta, EditableProp, EditablePropOption, ComponentMeta, } from './types';
|
|
2
2
|
export { CATEGORIES, COMPONENTS, getComponent, getCategory, getComponentsByCategory, } from './registry';
|
|
3
3
|
export { generateComponentCode } from './codegen';
|
|
4
|
+
export type { IconCatalogCategory } from './icons';
|
|
5
|
+
export { ICON_CATALOG } from './icons';
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/registry/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,UAAU,EACV,UAAU,EACV,YAAY,EACZ,WAAW,EACX,uBAAuB,GACxB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,UAAU,EAAE,SAAS,YAAY,EAO7C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,aAAa,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/registry/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE3D,eAAO,MAAM,UAAU,EAAE,SAAS,YAAY,EAO7C,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,aAAa,EA8lB9C,CAAC;AAEF,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAElE;AAED,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEhE;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,aAAa,EAAE,CAEpF"}
|
package/dist/registry/types.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export interface EditablePropOption {
|
|
|
15
15
|
export interface EditableProp {
|
|
16
16
|
readonly name: string;
|
|
17
17
|
readonly label: string;
|
|
18
|
-
readonly control: 'select' | 'text' | 'toggle' | 'number';
|
|
18
|
+
readonly control: 'select' | 'text' | 'toggle' | 'number' | 'discrete-slider';
|
|
19
19
|
readonly options?: readonly EditablePropOption[];
|
|
20
20
|
readonly defaultValue: string | number | boolean;
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC3C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/registry/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAC3C;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,iBAAiB,CAAC;IAC9E,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;CAClD;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,QAAQ,CAAC,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;CACjD"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -115,6 +115,7 @@ export type {
|
|
|
115
115
|
EditableProp,
|
|
116
116
|
EditablePropOption,
|
|
117
117
|
ComponentMeta,
|
|
118
|
+
IconCatalogCategory,
|
|
118
119
|
} from './registry';
|
|
119
120
|
export {
|
|
120
121
|
CATEGORIES,
|
|
@@ -123,6 +124,7 @@ export {
|
|
|
123
124
|
getCategory,
|
|
124
125
|
getComponentsByCategory,
|
|
125
126
|
generateComponentCode,
|
|
127
|
+
ICON_CATALOG,
|
|
126
128
|
} from './registry';
|
|
127
129
|
|
|
128
130
|
// Fonts
|
|
@@ -23,9 +23,7 @@ export function Icon({
|
|
|
23
23
|
opticalSize,
|
|
24
24
|
fill = 0,
|
|
25
25
|
color,
|
|
26
|
-
elevation = 1,
|
|
27
26
|
style,
|
|
28
|
-
onPress,
|
|
29
27
|
// Accessibility
|
|
30
28
|
accessibilityLabel,
|
|
31
29
|
// Testing & platform
|
|
@@ -33,8 +31,8 @@ export function Icon({
|
|
|
33
31
|
nativeID,
|
|
34
32
|
ref,
|
|
35
33
|
}: IconProps) {
|
|
36
|
-
//
|
|
37
|
-
const tokens = useTokens(
|
|
34
|
+
// Inherit tokens from nearest parent Frame via FrameContext.
|
|
35
|
+
const tokens = useTokens();
|
|
38
36
|
|
|
39
37
|
// Build the icon's style from the theme tokens and props.
|
|
40
38
|
// Wrapped in useMemo so it only recalculates when the inputs change,
|
|
@@ -69,7 +67,8 @@ export function Icon({
|
|
|
69
67
|
// wght: font weight (thinner or bolder strokes)
|
|
70
68
|
// GRAD: grade (fine-tune weight without changing overall size)
|
|
71
69
|
// opsz: optical size (adjusts detail level for the display size)
|
|
72
|
-
const
|
|
70
|
+
const fillValue = typeof fill === 'boolean' ? (fill ? 1 : 0) : fill;
|
|
71
|
+
const fontVariationSettings = `'FILL' ${fillValue}, 'wght' ${tokens.icons.weight}, 'GRAD' ${tokens.icons.grade}, 'opsz' ${opsz}`;
|
|
73
72
|
|
|
74
73
|
return {
|
|
75
74
|
fontFamily,
|
|
@@ -96,7 +95,6 @@ export function Icon({
|
|
|
96
95
|
// so assistive technology doesn't try to read the ligature text (e.g. "home").
|
|
97
96
|
importantForAccessibility={accessibilityLabel ? 'yes' : 'no-hide-descendants'}
|
|
98
97
|
style={iconStyle}
|
|
99
|
-
onPress={onPress} // When provided, makes the icon tappable
|
|
100
98
|
>
|
|
101
99
|
{name}
|
|
102
100
|
</Text>
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import type { Text as RNText, TextStyle } from 'react-native';
|
|
2
|
-
import type { ElevationLevel } from '../../theme/types';
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Props for Icon — Material Symbols icon with variable font support.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Icon is a pure presentation primitive. It inherits elevation from the
|
|
7
|
+
* nearest parent Frame via FrameContext. For interactive icons, wrap in
|
|
8
|
+
* `<Button icon="..." />` instead.
|
|
9
9
|
*
|
|
10
10
|
* @example
|
|
11
11
|
* ```tsx
|
|
12
12
|
* <Icon name="home" />
|
|
13
13
|
* <Icon name="settings" size={24} fill={1} />
|
|
14
14
|
* <Icon name="check" color="#00ff00" />
|
|
15
|
-
* <Icon name="delete" size={20} onPress={() => handleDelete()} />
|
|
16
15
|
* ```
|
|
17
16
|
*
|
|
18
17
|
* @see {@link https://fonts.google.com/icons Material Symbols icon reference}
|
|
@@ -35,23 +34,17 @@ export interface IconProps {
|
|
|
35
34
|
/**
|
|
36
35
|
* Fill state for the icon.
|
|
37
36
|
*
|
|
38
|
-
* - `0` — Outlined (default)
|
|
39
|
-
* - `1` — Filled (solid)
|
|
37
|
+
* - `false` / `0` — Outlined (default)
|
|
38
|
+
* - `true` / `1` — Filled (solid)
|
|
40
39
|
*/
|
|
41
|
-
readonly fill?: 0 | 1;
|
|
40
|
+
readonly fill?: boolean | 0 | 1;
|
|
42
41
|
|
|
43
42
|
/** Icon color as hex string. @default tokens.textPrimary */
|
|
44
43
|
readonly color?: string;
|
|
45
44
|
|
|
46
|
-
/**
|
|
47
|
-
readonly elevation?: ElevationLevel;
|
|
48
|
-
|
|
49
|
-
/** Additional styles applied to the icon Text element. */
|
|
45
|
+
/** Additional styles applied to the icon Text element (positioning, transforms). */
|
|
50
46
|
readonly style?: TextStyle;
|
|
51
47
|
|
|
52
|
-
/** Press handler — makes the icon tappable. */
|
|
53
|
-
readonly onPress?: () => void;
|
|
54
|
-
|
|
55
48
|
// ── Accessibility ──
|
|
56
49
|
|
|
57
50
|
/** Label read by screen readers. When omitted, the icon is treated as decorative (hidden from assistive technology). */
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
export interface IconCatalogCategory {
|
|
2
|
+
readonly id: string;
|
|
3
|
+
readonly label: string;
|
|
4
|
+
readonly icons: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const ICON_CATALOG: readonly IconCatalogCategory[] = [
|
|
8
|
+
{
|
|
9
|
+
id: 'navigation',
|
|
10
|
+
label: 'Navigation',
|
|
11
|
+
icons: [
|
|
12
|
+
'home', 'menu', 'close', 'arrow_back', 'arrow_forward',
|
|
13
|
+
'arrow_upward', 'arrow_downward', 'chevron_left', 'chevron_right',
|
|
14
|
+
'expand_more', 'expand_less', 'first_page', 'last_page',
|
|
15
|
+
'more_vert', 'more_horiz', 'unfold_more', 'unfold_less',
|
|
16
|
+
'subdirectory_arrow_right',
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'actions',
|
|
21
|
+
label: 'Actions',
|
|
22
|
+
icons: [
|
|
23
|
+
'search', 'settings', 'done', 'add', 'remove',
|
|
24
|
+
'delete', 'edit', 'save', 'refresh', 'undo',
|
|
25
|
+
'redo', 'download', 'upload', 'share', 'print',
|
|
26
|
+
'content_copy', 'content_paste', 'open_in_new', 'launch',
|
|
27
|
+
'drag_indicator', 'tune', 'sort', 'filter_list',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
id: 'communication',
|
|
32
|
+
label: 'Communication',
|
|
33
|
+
icons: [
|
|
34
|
+
'mail', 'chat', 'call', 'notifications', 'forum',
|
|
35
|
+
'send', 'inbox', 'drafts', 'mark_email_read',
|
|
36
|
+
'contact_mail', 'alternate_email', 'comment',
|
|
37
|
+
'chat_bubble', 'sms', 'voicemail',
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: 'content',
|
|
42
|
+
label: 'Content',
|
|
43
|
+
icons: [
|
|
44
|
+
'add_circle', 'remove_circle', 'check_circle', 'cancel',
|
|
45
|
+
'flag', 'bookmark', 'star', 'favorite',
|
|
46
|
+
'thumb_up', 'thumb_down', 'push_pin', 'link',
|
|
47
|
+
'link_off', 'bolt', 'label', 'inventory_2',
|
|
48
|
+
'visibility', 'visibility_off',
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
id: 'media',
|
|
53
|
+
label: 'Media',
|
|
54
|
+
icons: [
|
|
55
|
+
'play_arrow', 'pause', 'stop', 'skip_next', 'skip_previous',
|
|
56
|
+
'fast_forward', 'fast_rewind', 'replay', 'shuffle',
|
|
57
|
+
'repeat', 'volume_up', 'volume_off', 'music_note',
|
|
58
|
+
'image', 'photo_camera', 'videocam', 'mic',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'file',
|
|
63
|
+
label: 'File & Folder',
|
|
64
|
+
icons: [
|
|
65
|
+
'folder', 'folder_open', 'create_new_folder', 'description',
|
|
66
|
+
'file_copy', 'attach_file', 'cloud', 'cloud_upload',
|
|
67
|
+
'cloud_download', 'cloud_off', 'storage', 'snippet_folder',
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'social',
|
|
72
|
+
label: 'Social & People',
|
|
73
|
+
icons: [
|
|
74
|
+
'person', 'group', 'person_add', 'person_remove',
|
|
75
|
+
'people', 'face', 'sentiment_satisfied', 'sentiment_dissatisfied',
|
|
76
|
+
'public', 'workspace_premium', 'emoji_events', 'military_tech',
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
id: 'alerts',
|
|
81
|
+
label: 'Alerts & Status',
|
|
82
|
+
icons: [
|
|
83
|
+
'error', 'warning', 'info', 'help',
|
|
84
|
+
'check_circle', 'report', 'new_releases',
|
|
85
|
+
'notification_important', 'priority_high',
|
|
86
|
+
'verified', 'shield', 'security',
|
|
87
|
+
'lock', 'lock_open',
|
|
88
|
+
],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'device',
|
|
92
|
+
label: 'Device & Hardware',
|
|
93
|
+
icons: [
|
|
94
|
+
'phone_android', 'computer', 'tablet_mac', 'watch',
|
|
95
|
+
'keyboard', 'mouse', 'headphones', 'speaker',
|
|
96
|
+
'monitor', 'devices', 'memory', 'battery_full',
|
|
97
|
+
'wifi', 'bluetooth', 'usb', 'dark_mode', 'light_mode',
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: 'editor',
|
|
102
|
+
label: 'Editor & Formatting',
|
|
103
|
+
icons: [
|
|
104
|
+
'format_bold', 'format_italic', 'format_underlined',
|
|
105
|
+
'format_list_bulleted', 'format_list_numbered', 'format_quote',
|
|
106
|
+
'format_align_left', 'format_align_center', 'format_align_right',
|
|
107
|
+
'title', 'text_fields', 'code', 'palette',
|
|
108
|
+
'color_lens', 'brush', 'auto_fix_high',
|
|
109
|
+
],
|
|
110
|
+
},
|
|
111
|
+
];
|
package/src/registry/index.ts
CHANGED
package/src/registry/registry.ts
CHANGED
|
@@ -484,40 +484,35 @@ export const COMPONENTS: readonly ComponentMeta[] = [
|
|
|
484
484
|
name: 'Icon',
|
|
485
485
|
importName: 'Icon',
|
|
486
486
|
categoryId: 'primitives',
|
|
487
|
-
description: 'Material Symbols icon with size
|
|
487
|
+
description: 'Material Symbols icon with size and fill',
|
|
488
488
|
hasChildren: false,
|
|
489
489
|
variants: [
|
|
490
|
-
{ id: '
|
|
491
|
-
{ id: 'settings', label: 'Settings', props: { name: 'settings' } },
|
|
492
|
-
{ id: 'check', label: 'Check', props: { name: 'check' } },
|
|
493
|
-
{ id: 'add', label: 'Add', props: { name: 'add' } },
|
|
494
|
-
{ id: 'delete', label: 'Delete', props: { name: 'delete' } },
|
|
495
|
-
{ id: 'search', label: 'Search', props: { name: 'search' } },
|
|
496
|
-
{ id: 'filled', label: 'Filled Icon', props: { name: 'favorite', fill: 1 } },
|
|
497
|
-
{ id: 'large', label: 'Large Icon', props: { name: 'star', size: 32 } },
|
|
490
|
+
{ id: 'default', label: 'Default', props: { name: 'add' } },
|
|
498
491
|
],
|
|
499
492
|
editableProps: [
|
|
500
493
|
{
|
|
501
494
|
name: 'name',
|
|
502
495
|
label: 'Icon Name',
|
|
503
496
|
control: 'text',
|
|
504
|
-
defaultValue: '
|
|
497
|
+
defaultValue: 'add',
|
|
505
498
|
},
|
|
506
499
|
{
|
|
507
500
|
name: 'size',
|
|
508
501
|
label: 'Size',
|
|
509
|
-
control: '
|
|
502
|
+
control: 'discrete-slider',
|
|
503
|
+
options: [
|
|
504
|
+
{ label: '20', value: 20 },
|
|
505
|
+
{ label: '24', value: 24 },
|
|
506
|
+
{ label: '40', value: 40 },
|
|
507
|
+
{ label: '48', value: 48 },
|
|
508
|
+
],
|
|
510
509
|
defaultValue: 24,
|
|
511
510
|
},
|
|
512
511
|
{
|
|
513
512
|
name: 'fill',
|
|
514
513
|
label: 'Fill',
|
|
515
|
-
control: '
|
|
516
|
-
|
|
517
|
-
{ label: 'Outlined', value: 0 },
|
|
518
|
-
{ label: 'Filled', value: 1 },
|
|
519
|
-
],
|
|
520
|
-
defaultValue: 0,
|
|
514
|
+
control: 'toggle',
|
|
515
|
+
defaultValue: false,
|
|
521
516
|
},
|
|
522
517
|
],
|
|
523
518
|
},
|
package/src/registry/types.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface EditablePropOption {
|
|
|
18
18
|
export interface EditableProp {
|
|
19
19
|
readonly name: string;
|
|
20
20
|
readonly label: string;
|
|
21
|
-
readonly control: 'select' | 'text' | 'toggle' | 'number';
|
|
21
|
+
readonly control: 'select' | 'text' | 'toggle' | 'number' | 'discrete-slider';
|
|
22
22
|
readonly options?: readonly EditablePropOption[];
|
|
23
23
|
readonly defaultValue: string | number | boolean;
|
|
24
24
|
}
|