panelui-native 0.80.0 → 0.82.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.
Files changed (92) hide show
  1. package/lib/module/components/bottom-sheet/index.js +90 -17
  2. package/lib/module/components/bottom-sheet/index.js.map +1 -1
  3. package/lib/module/components/button/index.js +13 -0
  4. package/lib/module/components/button/index.js.map +1 -1
  5. package/lib/module/components/button-group/index.js +3 -0
  6. package/lib/module/components/button-group/index.js.map +1 -1
  7. package/lib/module/components/image-generation/dot-field.js +210 -0
  8. package/lib/module/components/image-generation/dot-field.js.map +1 -0
  9. package/lib/module/components/image-generation/index.js +417 -0
  10. package/lib/module/components/image-generation/index.js.map +1 -0
  11. package/lib/module/components/kpi/index.js +2 -4
  12. package/lib/module/components/kpi/index.js.map +1 -1
  13. package/lib/module/components/menu/index.js +8 -16
  14. package/lib/module/components/menu/index.js.map +1 -1
  15. package/lib/module/components/panelside/index.js +340 -33
  16. package/lib/module/components/panelside/index.js.map +1 -1
  17. package/lib/module/components/planner/index.js +446 -32
  18. package/lib/module/components/planner/index.js.map +1 -1
  19. package/lib/module/components/planner/planner-entries.js +36 -0
  20. package/lib/module/components/planner/planner-entries.js.map +1 -1
  21. package/lib/module/components/planner/planner-grid-navigation.js +34 -2
  22. package/lib/module/components/planner/planner-grid-navigation.js.map +1 -1
  23. package/lib/module/components/planner/planner-weeks.js +95 -0
  24. package/lib/module/components/planner/planner-weeks.js.map +1 -0
  25. package/lib/module/components/select/index.js +127 -23
  26. package/lib/module/components/select/index.js.map +1 -1
  27. package/lib/module/components/slide-button/index.js +610 -0
  28. package/lib/module/components/slide-button/index.js.map +1 -0
  29. package/lib/module/components/slide-button/slide-button-track.js +98 -0
  30. package/lib/module/components/slide-button/slide-button-track.js.map +1 -0
  31. package/lib/module/icons/index.js +553 -1934
  32. package/lib/module/icons/index.js.map +1 -1
  33. package/lib/module/index.js +3 -1
  34. package/lib/module/index.js.map +1 -1
  35. package/lib/module/primitives/portal.js +15 -1
  36. package/lib/module/primitives/portal.js.map +1 -1
  37. package/lib/module/utils/date.js +10 -3
  38. package/lib/module/utils/date.js.map +1 -1
  39. package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
  40. package/lib/typescript/src/components/button/index.d.ts +12 -0
  41. package/lib/typescript/src/components/button/index.d.ts.map +1 -1
  42. package/lib/typescript/src/components/button-group/index.d.ts +9 -0
  43. package/lib/typescript/src/components/button-group/index.d.ts.map +1 -1
  44. package/lib/typescript/src/components/image-generation/dot-field.d.ts +61 -0
  45. package/lib/typescript/src/components/image-generation/dot-field.d.ts.map +1 -0
  46. package/lib/typescript/src/components/image-generation/index.d.ts +126 -0
  47. package/lib/typescript/src/components/image-generation/index.d.ts.map +1 -0
  48. package/lib/typescript/src/components/kpi/index.d.ts.map +1 -1
  49. package/lib/typescript/src/components/menu/index.d.ts.map +1 -1
  50. package/lib/typescript/src/components/panelside/index.d.ts +194 -10
  51. package/lib/typescript/src/components/panelside/index.d.ts.map +1 -1
  52. package/lib/typescript/src/components/planner/index.d.ts +65 -4
  53. package/lib/typescript/src/components/planner/index.d.ts.map +1 -1
  54. package/lib/typescript/src/components/planner/planner-entries.d.ts +18 -0
  55. package/lib/typescript/src/components/planner/planner-entries.d.ts.map +1 -1
  56. package/lib/typescript/src/components/planner/planner-grid-navigation.d.ts +7 -1
  57. package/lib/typescript/src/components/planner/planner-grid-navigation.d.ts.map +1 -1
  58. package/lib/typescript/src/components/planner/planner-weeks.d.ts +50 -0
  59. package/lib/typescript/src/components/planner/planner-weeks.d.ts.map +1 -0
  60. package/lib/typescript/src/components/select/index.d.ts +75 -2
  61. package/lib/typescript/src/components/select/index.d.ts.map +1 -1
  62. package/lib/typescript/src/components/slide-button/index.d.ts +317 -0
  63. package/lib/typescript/src/components/slide-button/index.d.ts.map +1 -0
  64. package/lib/typescript/src/components/slide-button/slide-button-track.d.ts +70 -0
  65. package/lib/typescript/src/components/slide-button/slide-button-track.d.ts.map +1 -0
  66. package/lib/typescript/src/icons/index.d.ts +136 -189
  67. package/lib/typescript/src/icons/index.d.ts.map +1 -1
  68. package/lib/typescript/src/index.d.ts +5 -3
  69. package/lib/typescript/src/index.d.ts.map +1 -1
  70. package/lib/typescript/src/primitives/portal.d.ts.map +1 -1
  71. package/lib/typescript/src/utils/date.d.ts +1 -1
  72. package/lib/typescript/src/utils/date.d.ts.map +1 -1
  73. package/package.json +3 -2
  74. package/src/components/bottom-sheet/index.tsx +97 -17
  75. package/src/components/button/index.tsx +10 -2
  76. package/src/components/button-group/index.tsx +1 -0
  77. package/src/components/image-generation/dot-field.ts +226 -0
  78. package/src/components/image-generation/index.tsx +488 -0
  79. package/src/components/kpi/index.tsx +2 -4
  80. package/src/components/menu/index.tsx +10 -15
  81. package/src/components/panelside/index.tsx +498 -33
  82. package/src/components/planner/index.tsx +516 -38
  83. package/src/components/planner/planner-entries.ts +33 -0
  84. package/src/components/planner/planner-grid-navigation.ts +37 -2
  85. package/src/components/planner/planner-weeks.ts +90 -0
  86. package/src/components/select/index.tsx +158 -31
  87. package/src/components/slide-button/index.tsx +681 -0
  88. package/src/components/slide-button/slide-button-track.ts +100 -0
  89. package/src/icons/index.tsx +338 -1327
  90. package/src/index.ts +30 -0
  91. package/src/primitives/portal.tsx +15 -1
  92. package/src/utils/date.ts +13 -3
package/src/index.ts CHANGED
@@ -334,6 +334,7 @@ export {
334
334
  } from './components/radar-chart';
335
335
  export {
336
336
  Select,
337
+ useSelectSearch,
337
338
  type SelectProps,
338
339
  type SelectItemProps,
339
340
  type SelectGroupProps,
@@ -514,6 +515,12 @@ export {
514
515
  type FormFieldRenderProps,
515
516
  type UseFieldOptions,
516
517
  } from './components/form';
518
+ export {
519
+ ImageGeneration,
520
+ type ImageGenerationProps,
521
+ type ImageGenerationFieldProps,
522
+ type ImageGenerationStatus,
523
+ } from './components/image-generation';
517
524
  export { Input, type InputProps } from './components/input';
518
525
  export {
519
526
  InputGroup,
@@ -542,14 +549,26 @@ export {
542
549
  type PanelsideItemLabelProps,
543
550
  type PanelsideItemBadgeProps,
544
551
  type PanelsideActionProps,
552
+ type PanelsideItemActionsProps,
545
553
  type PanelsideFooterProps,
546
554
  type PanelsideCtaProps,
547
555
  type PanelsideSceneProps,
556
+ type PanelsidePagesProps,
557
+ type PanelsidePageProps,
548
558
  type PanelsideTriggerProps,
559
+ type PanelsideSearchTriggerProps,
560
+ type PanelsideSearchSheetProps,
561
+ type PanelsideSearchTabsProps,
562
+ type PanelsideSearchTabProps,
563
+ type PanelsideSearchResultsProps,
564
+ type PanelsideSearchResultProps,
565
+ type PanelsideSearchFieldProps,
549
566
  type PanelsideMode,
550
567
  type PanelsideSwipeFrom,
551
568
  type PanelsideItemSize,
552
569
  type PanelsideCtaSize,
570
+ type PanelsideSurface,
571
+ type PanelsideControlVariant,
553
572
  type UsePanelsideResult,
554
573
  } from './components/panelside';
555
574
  export {
@@ -833,6 +852,8 @@ export {
833
852
  type PlannerNavProps,
834
853
  type PlannerActionProps,
835
854
  type PlannerGridProps,
855
+ type PlannerScrollerProps,
856
+ type PlannerVariant,
836
857
  type PlannerDayProps,
837
858
  type PlannerDayState,
838
859
  type PlannerDayRenderer,
@@ -1070,6 +1091,15 @@ export {
1070
1091
  type ThinkingOrbState,
1071
1092
  } from './components/thinking-orb';
1072
1093
  export { Skeleton, type SkeletonProps } from './components/skeleton';
1094
+ export {
1095
+ SlideButton,
1096
+ useSlideButton,
1097
+ type SlideButtonProps,
1098
+ type SlideButtonLabelProps,
1099
+ type SlideButtonThumbProps,
1100
+ type SlideButtonVariant,
1101
+ type SlideButtonSize,
1102
+ } from './components/slide-button';
1073
1103
  export { Slider, type SliderProps } from './components/slider';
1074
1104
  export {
1075
1105
  Sortable,
@@ -75,11 +75,25 @@ export function Portal({ children }: { children: ReactNode }) {
75
75
  const store = usePortalStore('Portal');
76
76
  const key = useId();
77
77
 
78
+ /*
79
+ * Two effects, because they answer to different things.
80
+ *
81
+ * `children` is a new element on every render of whatever owns the portal,
82
+ * so an effect that both mounted and unmounted on it ran `unmount` then
83
+ * `mount` for every one of those renders — deleting the key from the store
84
+ * and putting it straight back, twice through `emit`, twice through a new
85
+ * Map, and a full re-render of the host each time. An open sheet re-rendering
86
+ * as its content changes paid that on every frame it changed on.
87
+ *
88
+ * Split, the update is an update and the teardown happens once, when the
89
+ * portal actually goes away.
90
+ */
78
91
  useEffect(() => {
79
92
  store.mount(key, children);
80
- return () => store.unmount(key);
81
93
  }, [store, key, children]);
82
94
 
95
+ useEffect(() => () => store.unmount(key), [store, key]);
96
+
83
97
  return null;
84
98
  }
85
99
 
package/src/utils/date.ts CHANGED
@@ -535,13 +535,23 @@ export function monthNames(locale: DateLocale, style: 'long' | 'short' = 'long')
535
535
  }
536
536
 
537
537
  /** Column headings, rotated so the first one is `weekStartsOn`. */
538
- export function weekdayNames(locale: DateLocale, weekStartsOn: number): string[] {
538
+ export function weekdayNames(
539
+ locale: DateLocale,
540
+ weekStartsOn: number,
541
+ /*
542
+ * `narrow` is a single letter in most locales, and several of them repeat —
543
+ * English has T twice and S twice. That is only safe where the column it
544
+ * heads is already unambiguous by position, which is why it is a caller's
545
+ * choice rather than the default.
546
+ */
547
+ width: 'short' | 'narrow' = 'short'
548
+ ): string[] {
539
549
  const first = normalizeWeekStart(weekStartsOn);
540
550
  // 2021-08-01 was a Sunday, so adding the index lands on each weekday in turn.
541
551
  return Array.from({ length: 7 }, (_unused, day) => {
542
552
  const index = (day + first) % 7;
543
- const formatted = formatGregory(new Date(2021, 7, 1 + index), locale, { weekday: 'short' });
544
- return formatted ?? WEEKDAYS_EN[index]!;
553
+ const formatted = formatGregory(new Date(2021, 7, 1 + index), locale, { weekday: width });
554
+ return formatted ?? (width === 'narrow' ? WEEKDAYS_EN[index]![0]! : WEEKDAYS_EN[index]!);
545
555
  });
546
556
  }
547
557