@photonix/basic 4.0.0 → 4.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.
package/dist/index.css CHANGED
@@ -7148,14 +7148,20 @@
7148
7148
  border-radius: var(--radius-full);
7149
7149
  corner-shape: round;
7150
7150
  }
7151
- .searchFieldRoot:hover:not(.searchFieldDisabled) {
7151
+ .searchFieldRoot:hover:not(.searchFieldDisabled, .bare) {
7152
7152
  background-color: var(--surface-state-hover);
7153
7153
  border-color: var(--border-state-hover);
7154
7154
  }
7155
- .searchFieldFocused {
7155
+ .searchFieldFocused:not(.bare) {
7156
7156
  border-color: var(--border-state-focus);
7157
7157
  box-shadow: inset 0 0 0 var(--border-sm) var(--border-state-focus);
7158
7158
  }
7159
+ .bare {
7160
+ background-color: transparent;
7161
+ border-color: transparent;
7162
+ border-radius: 0;
7163
+ padding: 0;
7164
+ }
7159
7165
  .searchFieldDisabled {
7160
7166
  background-color: var(--surface-state-disabled);
7161
7167
  cursor: not-allowed;
@@ -8734,6 +8740,22 @@
8734
8740
  .strokeAvatar .chipAvatar {
8735
8741
  --avatar-stroke-color: var(--surface-neutral-primary-inverse);
8736
8742
  }
8743
+ .iconSquare {
8744
+ justify-content: center;
8745
+ padding: 0;
8746
+ }
8747
+ .iconSquare .chipContainer {
8748
+ justify-content: center;
8749
+ }
8750
+ .iconSquare.large {
8751
+ inline-size: var(--dimensions-44);
8752
+ }
8753
+ .iconSquare.medium {
8754
+ inline-size: var(--dimensions-36);
8755
+ }
8756
+ .iconSquare.small {
8757
+ inline-size: var(--dimensions-32);
8758
+ }
8737
8759
  .disabled {
8738
8760
  cursor: not-allowed;
8739
8761
  pointer-events: none;
package/dist/index.d.mts CHANGED
@@ -765,6 +765,15 @@ interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
765
765
  * so typing replaces it. Handy for short numeric fields.
766
766
  */
767
767
  selectOnFocus?: boolean;
768
+ /**
769
+ * For `phone` and `bankAccount`: read numbers out of a whole message. Pasting
770
+ * "STK 0071000123456 Vietcombank, SĐT 0912 345 678" fills the field with the
771
+ * number of its kind instead of a run of digits, and hands the message to
772
+ * every other field (`useNumberSuggestions`). The field draws no suggestions
773
+ * itself: show them with your own UI wherever suits — a toolbar, a sheet, the
774
+ * keyboard's accessory. Default true.
775
+ */
776
+ smartPaste?: boolean;
768
777
  }
769
778
  declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
770
779
 
@@ -1037,6 +1046,12 @@ interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
1037
1046
  * Optional icon on the left
1038
1047
  */
1039
1048
  icon?: React.ReactNode;
1049
+ /**
1050
+ * Shows only `icon`: the label is hidden and becomes the chip's accessible
1051
+ * name. With nothing else in the chip (no badge, dropdown or action) it is a
1052
+ * circle as tall as a chip of the same size — e.g. the filter chip leading a ChipBar.
1053
+ */
1054
+ iconOnly?: boolean;
1040
1055
  /**
1041
1056
  * Optional avatar on the left
1042
1057
  */
@@ -1111,7 +1126,8 @@ type BarSurface = 'flat' | 'merged' | 'elevated';
1111
1126
 
1112
1127
  interface ChipBarProps extends React.HTMLAttributes<HTMLDivElement> {
1113
1128
  /**
1114
- * Element to show on the left, typically a filter Chip or IconButton
1129
+ * Element to show on the left, typically a filter Chip — `<Chip iconOnly …/>` for an
1130
+ * icon alone. It takes the bar's chip size, so it lines up with the chips beside it.
1115
1131
  */
1116
1132
  leading?: React.ReactNode;
1117
1133
  /**
@@ -1154,6 +1170,65 @@ interface VisuallyHiddenOwnProps {
1154
1170
  type VisuallyHiddenProps<C extends React.ElementType = 'span'> = PolymorphicComponentPropWithRef<C, VisuallyHiddenOwnProps>;
1155
1171
  declare const VisuallyHidden: React.ForwardRefExoticComponent<Omit<VisuallyHiddenProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<any>>;
1156
1172
 
1173
+ interface ShellSnapshot {
1174
+ /** A floating drawer is in the layout. */
1175
+ drawerFloating: boolean;
1176
+ /** Drawers mounted in the shell. */
1177
+ drawerCount: number;
1178
+ /** The floating drawer's card is shown. */
1179
+ open: boolean;
1180
+ /** The rail item the card was last opened from. */
1181
+ parentId: string | null;
1182
+ /** The rail's selected item. */
1183
+ selectedRailId: string | null;
1184
+ /** Rail items seen selected while no drawer was in the layout: their page has none. */
1185
+ noDrawer: ReadonlySet<string>;
1186
+ }
1187
+ /**
1188
+ * What the rail, drawer and top bar of one shell share, so the narrow-window behaviour needs no
1189
+ * wiring: which rail items own the drawer, whether its floating card is open, and how to go to
1190
+ * the page of the item it was opened from.
1191
+ */
1192
+ declare class ShellStore {
1193
+ private state;
1194
+ private listeners;
1195
+ private railClicks;
1196
+ private closeTimer;
1197
+ private floatingDrawers;
1198
+ /** Delay (ms) before the card closes, so the pointer can cross from the rail item to it. */
1199
+ closeDelay: number;
1200
+ subscribe: (listener: () => void) => () => void;
1201
+ getSnapshot: () => ShellSnapshot;
1202
+ private set;
1203
+ private reconcileQueued;
1204
+ /**
1205
+ * After a commit (rail items and drawers report in effects, in tree order), note whether the
1206
+ * selected item's page has a drawer.
1207
+ */
1208
+ private reconcile;
1209
+ /** A drawer joins (`+1`) or leaves (`-1`) the layout. */
1210
+ drawerMounted(delta: 1 | -1): void;
1211
+ /** A drawer starts (`true`) or stops floating. */
1212
+ drawerFloats(floating: boolean): void;
1213
+ /** A rail item reports its click handler; the selected one also marks itself. */
1214
+ railItem(id: string, selected: boolean, onClick: ((id: string) => void) | undefined): () => void;
1215
+ /**
1216
+ * Whether a rail item reveals the floating drawer: any item, while a drawer floats in the
1217
+ * shell, except one whose page turned out to have none. `hint` (NavItem `hasDrawer`) decides
1218
+ * outright when given.
1219
+ */
1220
+ isParent(id: string, hint?: boolean): boolean;
1221
+ /** Opens at once; closing waits `closeDelay` and any open on the way cancels it. */
1222
+ setOpen: (open: boolean) => void;
1223
+ /** Pointer or focus entering / leaving a parent rail item. */
1224
+ hoverParent(id: string, hovering: boolean): void;
1225
+ /** The app's own drawer toggle, while floating: show the card for the selected item, or hide it. */
1226
+ toggleForSelected(): void;
1227
+ close: () => void;
1228
+ /** An item was chosen in the floating card: go to the page it was opened from, then close. */
1229
+ choose(): void;
1230
+ }
1231
+
1157
1232
  interface LayoutContextValue {
1158
1233
  /** Whether a NavigationDrawer is present in the layout */
1159
1234
  hasDrawer: boolean;
@@ -1161,6 +1236,8 @@ interface LayoutContextValue {
1161
1236
  registerDrawer: () => void;
1162
1237
  /** Unregister a drawer (called by NavigationDrawer on unmount) */
1163
1238
  unregisterDrawer: () => void;
1239
+ /** State the shell's rail, drawer and top bar share (narrow-window behaviour). */
1240
+ shell: ShellStore;
1164
1241
  }
1165
1242
  declare const LayoutContext: React.Context<LayoutContextValue | null>;
1166
1243
  interface LayoutProviderProps {
package/dist/index.d.ts CHANGED
@@ -765,6 +765,15 @@ interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement
765
765
  * so typing replaces it. Handy for short numeric fields.
766
766
  */
767
767
  selectOnFocus?: boolean;
768
+ /**
769
+ * For `phone` and `bankAccount`: read numbers out of a whole message. Pasting
770
+ * "STK 0071000123456 Vietcombank, SĐT 0912 345 678" fills the field with the
771
+ * number of its kind instead of a run of digits, and hands the message to
772
+ * every other field (`useNumberSuggestions`). The field draws no suggestions
773
+ * itself: show them with your own UI wherever suits — a toolbar, a sheet, the
774
+ * keyboard's accessory. Default true.
775
+ */
776
+ smartPaste?: boolean;
768
777
  }
769
778
  declare const TextField: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<HTMLInputElement>>;
770
779
 
@@ -1037,6 +1046,12 @@ interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
1037
1046
  * Optional icon on the left
1038
1047
  */
1039
1048
  icon?: React.ReactNode;
1049
+ /**
1050
+ * Shows only `icon`: the label is hidden and becomes the chip's accessible
1051
+ * name. With nothing else in the chip (no badge, dropdown or action) it is a
1052
+ * circle as tall as a chip of the same size — e.g. the filter chip leading a ChipBar.
1053
+ */
1054
+ iconOnly?: boolean;
1040
1055
  /**
1041
1056
  * Optional avatar on the left
1042
1057
  */
@@ -1111,7 +1126,8 @@ type BarSurface = 'flat' | 'merged' | 'elevated';
1111
1126
 
1112
1127
  interface ChipBarProps extends React.HTMLAttributes<HTMLDivElement> {
1113
1128
  /**
1114
- * Element to show on the left, typically a filter Chip or IconButton
1129
+ * Element to show on the left, typically a filter Chip — `<Chip iconOnly …/>` for an
1130
+ * icon alone. It takes the bar's chip size, so it lines up with the chips beside it.
1115
1131
  */
1116
1132
  leading?: React.ReactNode;
1117
1133
  /**
@@ -1154,6 +1170,65 @@ interface VisuallyHiddenOwnProps {
1154
1170
  type VisuallyHiddenProps<C extends React.ElementType = 'span'> = PolymorphicComponentPropWithRef<C, VisuallyHiddenOwnProps>;
1155
1171
  declare const VisuallyHidden: React.ForwardRefExoticComponent<Omit<VisuallyHiddenProps<React.ElementType<any, keyof React.JSX.IntrinsicElements>>, "ref"> & React.RefAttributes<any>>;
1156
1172
 
1173
+ interface ShellSnapshot {
1174
+ /** A floating drawer is in the layout. */
1175
+ drawerFloating: boolean;
1176
+ /** Drawers mounted in the shell. */
1177
+ drawerCount: number;
1178
+ /** The floating drawer's card is shown. */
1179
+ open: boolean;
1180
+ /** The rail item the card was last opened from. */
1181
+ parentId: string | null;
1182
+ /** The rail's selected item. */
1183
+ selectedRailId: string | null;
1184
+ /** Rail items seen selected while no drawer was in the layout: their page has none. */
1185
+ noDrawer: ReadonlySet<string>;
1186
+ }
1187
+ /**
1188
+ * What the rail, drawer and top bar of one shell share, so the narrow-window behaviour needs no
1189
+ * wiring: which rail items own the drawer, whether its floating card is open, and how to go to
1190
+ * the page of the item it was opened from.
1191
+ */
1192
+ declare class ShellStore {
1193
+ private state;
1194
+ private listeners;
1195
+ private railClicks;
1196
+ private closeTimer;
1197
+ private floatingDrawers;
1198
+ /** Delay (ms) before the card closes, so the pointer can cross from the rail item to it. */
1199
+ closeDelay: number;
1200
+ subscribe: (listener: () => void) => () => void;
1201
+ getSnapshot: () => ShellSnapshot;
1202
+ private set;
1203
+ private reconcileQueued;
1204
+ /**
1205
+ * After a commit (rail items and drawers report in effects, in tree order), note whether the
1206
+ * selected item's page has a drawer.
1207
+ */
1208
+ private reconcile;
1209
+ /** A drawer joins (`+1`) or leaves (`-1`) the layout. */
1210
+ drawerMounted(delta: 1 | -1): void;
1211
+ /** A drawer starts (`true`) or stops floating. */
1212
+ drawerFloats(floating: boolean): void;
1213
+ /** A rail item reports its click handler; the selected one also marks itself. */
1214
+ railItem(id: string, selected: boolean, onClick: ((id: string) => void) | undefined): () => void;
1215
+ /**
1216
+ * Whether a rail item reveals the floating drawer: any item, while a drawer floats in the
1217
+ * shell, except one whose page turned out to have none. `hint` (NavItem `hasDrawer`) decides
1218
+ * outright when given.
1219
+ */
1220
+ isParent(id: string, hint?: boolean): boolean;
1221
+ /** Opens at once; closing waits `closeDelay` and any open on the way cancels it. */
1222
+ setOpen: (open: boolean) => void;
1223
+ /** Pointer or focus entering / leaving a parent rail item. */
1224
+ hoverParent(id: string, hovering: boolean): void;
1225
+ /** The app's own drawer toggle, while floating: show the card for the selected item, or hide it. */
1226
+ toggleForSelected(): void;
1227
+ close: () => void;
1228
+ /** An item was chosen in the floating card: go to the page it was opened from, then close. */
1229
+ choose(): void;
1230
+ }
1231
+
1157
1232
  interface LayoutContextValue {
1158
1233
  /** Whether a NavigationDrawer is present in the layout */
1159
1234
  hasDrawer: boolean;
@@ -1161,6 +1236,8 @@ interface LayoutContextValue {
1161
1236
  registerDrawer: () => void;
1162
1237
  /** Unregister a drawer (called by NavigationDrawer on unmount) */
1163
1238
  unregisterDrawer: () => void;
1239
+ /** State the shell's rail, drawer and top bar share (narrow-window behaviour). */
1240
+ shell: ShellStore;
1164
1241
  }
1165
1242
  declare const LayoutContext: React.Context<LayoutContextValue | null>;
1166
1243
  interface LayoutProviderProps {