@texturehq/edges 2.0.0 → 2.1.0

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.
@@ -2,11 +2,47 @@ import * as React$1 from 'react';
2
2
  import React__default from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as PhosphorIcons from '@phosphor-icons/react';
5
- import { IconProps as IconProps$1 } from '@phosphor-icons/react';
5
+ import { Icon as Icon$1, IconProps as IconProps$1 } from '@phosphor-icons/react';
6
6
  import { TextProps, DateValue, DateFieldProps as DateFieldProps$1, ValidationResult } from 'react-aria-components';
7
7
 
8
+ /**
9
+ * Registry of all custom icons, keyed by name. The Edges `Icon` resolver checks
10
+ * this map first, then falls back to Phosphor. `as const satisfies` keeps the
11
+ * keys as a literal union (drives `CustomIconName` + autocomplete) while
12
+ * type-checking each value is a Phosphor-compatible component.
13
+ */
14
+ declare const CUSTOM_ICON_REGISTRY: {
15
+ readonly TextureRecloser: Icon$1;
16
+ readonly TextureFuse: Icon$1;
17
+ readonly TextureBreaker: Icon$1;
18
+ readonly TextureSource: Icon$1;
19
+ readonly TextureCapacitor: Icon$1;
20
+ readonly TextureRegulator: Icon$1;
21
+ readonly TextureSwitch: Icon$1;
22
+ readonly TextureSwitchClosed: Icon$1;
23
+ readonly TextureSectionalizerOpen: Icon$1;
24
+ readonly TextureSectionalizerClosed: Icon$1;
25
+ readonly TextureTransformer: Icon$1;
26
+ readonly TextureSinglePhaseOverheadLine: Icon$1;
27
+ readonly TextureTwoPhaseOverheadLine: Icon$1;
28
+ readonly TextureThreePhaseOverheadLine: Icon$1;
29
+ readonly TextureSinglePhaseUndergroundLine: Icon$1;
30
+ readonly TextureTwoPhaseUndergroundLine: Icon$1;
31
+ readonly TextureThreePhaseUndergroundLine: Icon$1;
32
+ readonly TextureSupportStructure: Icon$1;
33
+ };
34
+ /** Union of all custom icon names. Folded into `IconName`. */
35
+ type CustomIconName = keyof typeof CUSTOM_ICON_REGISTRY;
36
+
8
37
  type PhosphorIconName = keyof typeof PhosphorIcons;
9
- type IconName = PhosphorIconName;
38
+
39
+ /**
40
+ * All icon names accepted by `<Icon name="…" />` — every Phosphor icon plus
41
+ * Texture's custom icons (see `customIcons/registry.tsx`). Custom names are
42
+ * prefixed `Texture*` and resolve through `CUSTOM_ICON_REGISTRY` first, then
43
+ * Phosphor.
44
+ */
45
+ type IconName = PhosphorIconName | CustomIconName;
10
46
  declare const sizePresets: {
11
47
  readonly xs: 16;
12
48
  readonly sm: 20;
@@ -18,10 +54,10 @@ declare const sizePresets: {
18
54
  type SizePreset = keyof typeof sizePresets;
19
55
  interface IconProps extends Omit<IconProps$1, "size"> {
20
56
  /**
21
- * The name of the Phosphor icon to render
22
- * Any valid icon from @phosphor-icons/react
57
+ * The name of the icon to render — any valid icon from @phosphor-icons/react,
58
+ * or a Texture custom icon (see customIcons/registry.tsx).
23
59
  */
24
- name: PhosphorIconName;
60
+ name: IconName;
25
61
  /**
26
62
  * Size of the icon - can be a preset or custom number
27
63
  */
@@ -34,14 +70,19 @@ interface IconProps extends Omit<IconProps$1, "size"> {
34
70
  /**
35
71
  * Icon
36
72
  *
37
- * Phosphor icon wrapper component with standardized sizing and styling.
38
- * Provides access to the full Phosphor icon library with tree-shaking support and design system presets.
39
- * - TypeScript autocomplete for all icon names
73
+ * Icon wrapper component with standardized sizing and styling. Provides access
74
+ * to the full Phosphor icon library PLUS Texture's custom icons through one
75
+ * unified `name` API, with tree-shaking support and design system presets.
76
+ * - TypeScript autocomplete for all icon names (Phosphor + custom)
77
+ *
78
+ * Custom icons resolve through `CUSTOM_ICON_REGISTRY` first, then fall back to
79
+ * Phosphor — so `<Icon name="TextureRecloser" />` works exactly like
80
+ * `<Icon name="House" />`.
40
81
  *
41
82
  * Usage:
42
83
  * ```tsx
43
84
  * <Icon name="House" size="md" />
44
- * <Icon name="User" size={32} className="text-brand" />
85
+ * <Icon name="TextureRecloser" size={32} className="text-brand" />
45
86
  * ```
46
87
  */
47
88
  declare const Icon: React$1.MemoExoticComponent<({ name, size, color, weight, className, ariaLabel, ...props }: IconProps) => react_jsx_runtime.JSX.Element | null>;
@@ -403,4 +444,4 @@ interface RichTextEditorProps {
403
444
  */
404
445
  declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, id, size, headingLevels, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
405
446
 
406
- export { type BaseInputProps as B, ClearButton as C, type DateFieldProps as D, type FileUploadProps as F, Icon as I, Label as L, type RichTextEditorProps as R, type Size as S, DateField as a, FileUpload as b, RichTextEditor as c, type IconName as d, type BaseProps as e, Description as f, type DescriptionPlacement as g, type DescriptionProps as h, FieldError as i, type FieldErrorProps as j, FieldGroup as k, type FieldGroupProps as l, Input as m, type InputProps as n, type InputStyleProps as o, InputWrapper as p, type LabelProps as q, getFieldGroupStyles as r, getInputBackgroundStyles as s, getInputBaseStyles as t, getInputStateStyles as u, useInputFocus as v };
447
+ export { type BaseInputProps as B, CUSTOM_ICON_REGISTRY as C, type DateFieldProps as D, type FileUploadProps as F, Icon as I, Label as L, type PhosphorIconName as P, type RichTextEditorProps as R, type Size as S, DateField as a, FileUpload as b, RichTextEditor as c, type IconName as d, type BaseProps as e, ClearButton as f, type CustomIconName as g, Description as h, type DescriptionPlacement as i, type DescriptionProps as j, FieldError as k, type FieldErrorProps as l, FieldGroup as m, type FieldGroupProps as n, Input as o, type InputProps as p, type InputStyleProps as q, InputWrapper as r, type LabelProps as s, getFieldGroupStyles as t, getInputBackgroundStyles as u, getInputBaseStyles as v, getInputStateStyles as w, useInputFocus as x };
@@ -2,11 +2,47 @@ import * as React$1 from 'react';
2
2
  import React__default from 'react';
3
3
  import * as react_jsx_runtime from 'react/jsx-runtime';
4
4
  import * as PhosphorIcons from '@phosphor-icons/react';
5
- import { IconProps as IconProps$1 } from '@phosphor-icons/react';
5
+ import { Icon as Icon$1, IconProps as IconProps$1 } from '@phosphor-icons/react';
6
6
  import { TextProps, DateValue, DateFieldProps as DateFieldProps$1, ValidationResult } from 'react-aria-components';
7
7
 
8
+ /**
9
+ * Registry of all custom icons, keyed by name. The Edges `Icon` resolver checks
10
+ * this map first, then falls back to Phosphor. `as const satisfies` keeps the
11
+ * keys as a literal union (drives `CustomIconName` + autocomplete) while
12
+ * type-checking each value is a Phosphor-compatible component.
13
+ */
14
+ declare const CUSTOM_ICON_REGISTRY: {
15
+ readonly TextureRecloser: Icon$1;
16
+ readonly TextureFuse: Icon$1;
17
+ readonly TextureBreaker: Icon$1;
18
+ readonly TextureSource: Icon$1;
19
+ readonly TextureCapacitor: Icon$1;
20
+ readonly TextureRegulator: Icon$1;
21
+ readonly TextureSwitch: Icon$1;
22
+ readonly TextureSwitchClosed: Icon$1;
23
+ readonly TextureSectionalizerOpen: Icon$1;
24
+ readonly TextureSectionalizerClosed: Icon$1;
25
+ readonly TextureTransformer: Icon$1;
26
+ readonly TextureSinglePhaseOverheadLine: Icon$1;
27
+ readonly TextureTwoPhaseOverheadLine: Icon$1;
28
+ readonly TextureThreePhaseOverheadLine: Icon$1;
29
+ readonly TextureSinglePhaseUndergroundLine: Icon$1;
30
+ readonly TextureTwoPhaseUndergroundLine: Icon$1;
31
+ readonly TextureThreePhaseUndergroundLine: Icon$1;
32
+ readonly TextureSupportStructure: Icon$1;
33
+ };
34
+ /** Union of all custom icon names. Folded into `IconName`. */
35
+ type CustomIconName = keyof typeof CUSTOM_ICON_REGISTRY;
36
+
8
37
  type PhosphorIconName = keyof typeof PhosphorIcons;
9
- type IconName = PhosphorIconName;
38
+
39
+ /**
40
+ * All icon names accepted by `<Icon name="…" />` — every Phosphor icon plus
41
+ * Texture's custom icons (see `customIcons/registry.tsx`). Custom names are
42
+ * prefixed `Texture*` and resolve through `CUSTOM_ICON_REGISTRY` first, then
43
+ * Phosphor.
44
+ */
45
+ type IconName = PhosphorIconName | CustomIconName;
10
46
  declare const sizePresets: {
11
47
  readonly xs: 16;
12
48
  readonly sm: 20;
@@ -18,10 +54,10 @@ declare const sizePresets: {
18
54
  type SizePreset = keyof typeof sizePresets;
19
55
  interface IconProps extends Omit<IconProps$1, "size"> {
20
56
  /**
21
- * The name of the Phosphor icon to render
22
- * Any valid icon from @phosphor-icons/react
57
+ * The name of the icon to render — any valid icon from @phosphor-icons/react,
58
+ * or a Texture custom icon (see customIcons/registry.tsx).
23
59
  */
24
- name: PhosphorIconName;
60
+ name: IconName;
25
61
  /**
26
62
  * Size of the icon - can be a preset or custom number
27
63
  */
@@ -34,14 +70,19 @@ interface IconProps extends Omit<IconProps$1, "size"> {
34
70
  /**
35
71
  * Icon
36
72
  *
37
- * Phosphor icon wrapper component with standardized sizing and styling.
38
- * Provides access to the full Phosphor icon library with tree-shaking support and design system presets.
39
- * - TypeScript autocomplete for all icon names
73
+ * Icon wrapper component with standardized sizing and styling. Provides access
74
+ * to the full Phosphor icon library PLUS Texture's custom icons through one
75
+ * unified `name` API, with tree-shaking support and design system presets.
76
+ * - TypeScript autocomplete for all icon names (Phosphor + custom)
77
+ *
78
+ * Custom icons resolve through `CUSTOM_ICON_REGISTRY` first, then fall back to
79
+ * Phosphor — so `<Icon name="TextureRecloser" />` works exactly like
80
+ * `<Icon name="House" />`.
40
81
  *
41
82
  * Usage:
42
83
  * ```tsx
43
84
  * <Icon name="House" size="md" />
44
- * <Icon name="User" size={32} className="text-brand" />
85
+ * <Icon name="TextureRecloser" size={32} className="text-brand" />
45
86
  * ```
46
87
  */
47
88
  declare const Icon: React$1.MemoExoticComponent<({ name, size, color, weight, className, ariaLabel, ...props }: IconProps) => react_jsx_runtime.JSX.Element | null>;
@@ -403,4 +444,4 @@ interface RichTextEditorProps {
403
444
  */
404
445
  declare function RichTextEditor({ initialContent, onChange, className, isDisabled, placeholder, id, size, headingLevels, }: RichTextEditorProps): react_jsx_runtime.JSX.Element | null;
405
446
 
406
- export { type BaseInputProps as B, ClearButton as C, type DateFieldProps as D, type FileUploadProps as F, Icon as I, Label as L, type RichTextEditorProps as R, type Size as S, DateField as a, FileUpload as b, RichTextEditor as c, type IconName as d, type BaseProps as e, Description as f, type DescriptionPlacement as g, type DescriptionProps as h, FieldError as i, type FieldErrorProps as j, FieldGroup as k, type FieldGroupProps as l, Input as m, type InputProps as n, type InputStyleProps as o, InputWrapper as p, type LabelProps as q, getFieldGroupStyles as r, getInputBackgroundStyles as s, getInputBaseStyles as t, getInputStateStyles as u, useInputFocus as v };
447
+ export { type BaseInputProps as B, CUSTOM_ICON_REGISTRY as C, type DateFieldProps as D, type FileUploadProps as F, Icon as I, Label as L, type PhosphorIconName as P, type RichTextEditorProps as R, type Size as S, DateField as a, FileUpload as b, RichTextEditor as c, type IconName as d, type BaseProps as e, ClearButton as f, type CustomIconName as g, Description as h, type DescriptionPlacement as i, type DescriptionProps as j, FieldError as k, type FieldErrorProps as l, FieldGroup as m, type FieldGroupProps as n, Input as o, type InputProps as p, type InputStyleProps as q, InputWrapper as r, type LabelProps as s, getFieldGroupStyles as t, getInputBackgroundStyles as u, getInputBaseStyles as v, getInputStateStyles as w, useInputFocus as x };
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ComponentProps, ReactNode } from 'react';
3
3
  import { Key, ValidationResult, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, CheckboxRenderProps, CheckboxGroupProps as CheckboxGroupProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, RadioProps, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue } from 'react-aria-components';
4
- import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-diZqy_s1.js';
4
+ import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-BNXNpG4s.js';
5
5
 
6
6
  interface Item {
7
7
  id: string;
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ComponentProps, ReactNode } from 'react';
3
3
  import { Key, ValidationResult, ButtonProps as ButtonProps$1, CheckboxProps as CheckboxProps$1, CheckboxRenderProps, CheckboxGroupProps as CheckboxGroupProps$1, TextFieldProps as TextFieldProps$1, NumberFieldProps as NumberFieldProps$1, RadioProps, RadioGroupProps as RadioGroupProps$1, SelectProps as SelectProps$1, SwitchProps as SwitchProps$1, TimeFieldProps as TimeFieldProps$1, TimeValue } from 'react-aria-components';
4
- import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-diZqy_s1.cjs';
4
+ import { S as Size, I as Icon, B as BaseInputProps } from './RichTextEditor-BNXNpG4s.cjs';
5
5
 
6
6
  interface Item {
7
7
  id: string;