@almadar/ui 5.76.6 → 5.77.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.
@@ -4039,7 +4039,11 @@ var init_Switch = __esm({
4039
4039
  disabled,
4040
4040
  onClick: handleClick,
4041
4041
  className: cn(
4042
- "relative inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
4042
+ // Fixed rem sizes instead of spacing tokens: themes like atelier
4043
+ // redefine --space-11 to 68px, which makes w-11 enormous and leaves
4044
+ // the thumb stuck near the left edge. The switch geometry must stay
4045
+ // proportional regardless of a theme's density scale.
4046
+ "relative inline-flex h-[1.5rem] w-[2.75rem] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
4043
4047
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",
4044
4048
  isChecked ? "bg-primary" : "bg-muted",
4045
4049
  disabled && "cursor-not-allowed opacity-50"
@@ -4048,8 +4052,8 @@ var init_Switch = __esm({
4048
4052
  "span",
4049
4053
  {
4050
4054
  className: cn(
4051
- "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
4052
- isChecked ? "translate-x-5" : "translate-x-0"
4055
+ "pointer-events-none block h-[1.25rem] w-[1.25rem] rounded-full bg-background shadow-lg ring-0 transition-transform",
4056
+ isChecked ? "translate-x-[1.25rem]" : "translate-x-0"
4053
4057
  )
4054
4058
  }
4055
4059
  )
@@ -17041,129 +17045,6 @@ var init_BuilderBoard = __esm({
17041
17045
  BuilderBoard.displayName = "BuilderBoard";
17042
17046
  }
17043
17047
  });
17044
- function useSafeEventBus2() {
17045
- try {
17046
- return useEventBus();
17047
- } catch {
17048
- return { emit: () => {
17049
- }, on: () => () => {
17050
- }, once: () => {
17051
- } };
17052
- }
17053
- }
17054
- var log6, lookStyles4; exports.ButtonGroup = void 0;
17055
- var init_ButtonGroup = __esm({
17056
- "components/core/molecules/ButtonGroup.tsx"() {
17057
- "use client";
17058
- init_cn();
17059
- init_atoms();
17060
- init_useEventBus();
17061
- log6 = logger.createLogger("almadar:ui:button-group");
17062
- lookStyles4 = {
17063
- "right-aligned-buttons": "",
17064
- "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
17065
- "inline-row": "gap-2 inline-flex",
17066
- "dropdown-menu": "[&>button:not(:first-child)]:hidden",
17067
- "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
17068
- };
17069
- exports.ButtonGroup = ({
17070
- children,
17071
- primary,
17072
- secondary,
17073
- variant = "default",
17074
- orientation = "horizontal",
17075
- className,
17076
- // Filter-group pattern props (entity and filters are used for schema-driven filtering)
17077
- entity: _entity,
17078
- filters,
17079
- look = "right-aligned-buttons"
17080
- }) => {
17081
- const eventBus = useSafeEventBus2();
17082
- const variantClasses2 = {
17083
- default: "gap-0",
17084
- segmented: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0",
17085
- toggle: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0"
17086
- };
17087
- const orientationClasses = {
17088
- horizontal: "flex-row",
17089
- vertical: "flex-col [&>button:first-child]:rounded-t-lg [&>button:last-child]:rounded-b-lg [&>button:not(:first-child)]:border-t-0 [&>button:not(:first-child)]:border-l"
17090
- };
17091
- const handleActionClick = (action) => {
17092
- if (action.event) {
17093
- eventBus.emit("UI:DISPATCH", { event: action.event });
17094
- }
17095
- if (action.navigatesTo) {
17096
- eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
17097
- }
17098
- };
17099
- const renderFormActions = () => {
17100
- const buttons = [];
17101
- if (secondary) {
17102
- secondary.forEach((action, index) => {
17103
- buttons.push(
17104
- /* @__PURE__ */ jsxRuntime.jsx(
17105
- exports.Button,
17106
- {
17107
- type: action.actionType === "submit" ? "submit" : "button",
17108
- variant: action.variant || "ghost",
17109
- onClick: () => handleActionClick(action),
17110
- children: action.label
17111
- },
17112
- `secondary-${index}`
17113
- )
17114
- );
17115
- });
17116
- }
17117
- if (primary) {
17118
- const isSubmit = primary.actionType === "submit";
17119
- buttons.push(
17120
- /* @__PURE__ */ jsxRuntime.jsx(
17121
- exports.Button,
17122
- {
17123
- type: isSubmit ? "submit" : "button",
17124
- variant: primary.variant || "primary",
17125
- onClick: () => handleActionClick(primary),
17126
- "data-testid": isSubmit ? "form-submit" : void 0,
17127
- children: primary.label
17128
- },
17129
- "primary"
17130
- )
17131
- );
17132
- }
17133
- return buttons;
17134
- };
17135
- const renderFilters = () => {
17136
- if (!filters || filters.length === 0) return null;
17137
- return filters.map((filter, index) => /* @__PURE__ */ jsxRuntime.jsx(
17138
- exports.Button,
17139
- {
17140
- variant: "ghost",
17141
- onClick: () => {
17142
- log6.debug("Filter clicked", { field: filter.field });
17143
- },
17144
- children: filter.label
17145
- },
17146
- `filter-${filter.field}-${index}`
17147
- ));
17148
- };
17149
- return /* @__PURE__ */ jsxRuntime.jsx(
17150
- "div",
17151
- {
17152
- className: cn(
17153
- "inline-flex gap-2",
17154
- variantClasses2[variant],
17155
- orientationClasses[orientation],
17156
- lookStyles4[look],
17157
- className
17158
- ),
17159
- role: "group",
17160
- children: children || renderFilters() || renderFormActions()
17161
- }
17162
- );
17163
- };
17164
- exports.ButtonGroup.displayName = "ButtonGroup";
17165
- }
17166
- });
17167
17048
  function useSwipeGesture(callbacks, options = {}) {
17168
17049
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
17169
17050
  const startX = React80.useRef(0);
@@ -19590,7 +19471,7 @@ var init_CardGrid = __esm({
19590
19471
  exports.CardGrid.displayName = "CardGrid";
19591
19472
  }
19592
19473
  });
19593
- function useSafeEventBus3() {
19474
+ function useSafeEventBus2() {
19594
19475
  try {
19595
19476
  return useEventBus();
19596
19477
  } catch {
@@ -19626,7 +19507,7 @@ var init_Carousel = __esm({
19626
19507
  const [activeIndex, setActiveIndex] = React80.useState(0);
19627
19508
  const scrollRef = React80.useRef(null);
19628
19509
  const autoPlayRef = React80.useRef(null);
19629
- const eventBus = useSafeEventBus3();
19510
+ const eventBus = useSafeEventBus2();
19630
19511
  const { t } = hooks.useTranslate();
19631
19512
  const safeItems = items ?? [];
19632
19513
  const totalSlides = safeItems.length;
@@ -24251,7 +24132,7 @@ function DataGrid({
24251
24132
  /* @__PURE__ */ jsxRuntime.jsx(
24252
24133
  exports.Box,
24253
24134
  {
24254
- className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles5[look], className),
24135
+ className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles4[look], className),
24255
24136
  style: scrollX ? { gridAutoFlow: "column", gridAutoColumns: `minmax(${minCardWidth}px, 1fr)` } : gridTemplateColumns ? { gridTemplateColumns } : void 0,
24256
24137
  children: data.map((item, index) => {
24257
24138
  const itemData = item;
@@ -24446,7 +24327,7 @@ function DataGrid({
24446
24327
  ] })
24447
24328
  );
24448
24329
  }
24449
- var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles5;
24330
+ var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles4;
24450
24331
  var init_DataGrid = __esm({
24451
24332
  "components/core/molecules/DataGrid.tsx"() {
24452
24333
  "use client";
@@ -24481,7 +24362,7 @@ var init_DataGrid = __esm({
24481
24362
  lg: "gap-6",
24482
24363
  xl: "gap-8"
24483
24364
  };
24484
- lookStyles5 = {
24365
+ lookStyles4 = {
24485
24366
  dense: "gap-2 [&>*]:p-card-sm",
24486
24367
  spacious: "gap-8 [&>*]:p-card-lg",
24487
24368
  striped: "[&>*:nth-child(even)]:bg-muted/30",
@@ -26025,6 +25906,129 @@ var init_FormField = __esm({
26025
25906
  exports.FormField.displayName = "FormField";
26026
25907
  }
26027
25908
  });
25909
+ function useSafeEventBus3() {
25910
+ try {
25911
+ return useEventBus();
25912
+ } catch {
25913
+ return { emit: () => {
25914
+ }, on: () => () => {
25915
+ }, once: () => {
25916
+ } };
25917
+ }
25918
+ }
25919
+ var log6, lookStyles5; exports.ButtonGroup = void 0;
25920
+ var init_ButtonGroup = __esm({
25921
+ "components/core/molecules/ButtonGroup.tsx"() {
25922
+ "use client";
25923
+ init_cn();
25924
+ init_atoms();
25925
+ init_useEventBus();
25926
+ log6 = logger.createLogger("almadar:ui:button-group");
25927
+ lookStyles5 = {
25928
+ "right-aligned-buttons": "",
25929
+ "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
25930
+ "inline-row": "gap-2 inline-flex",
25931
+ "dropdown-menu": "[&>button:not(:first-child)]:hidden",
25932
+ "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
25933
+ };
25934
+ exports.ButtonGroup = ({
25935
+ children,
25936
+ primary,
25937
+ secondary,
25938
+ variant = "default",
25939
+ orientation = "horizontal",
25940
+ className,
25941
+ // Filter-group pattern props (entity and filters are used for schema-driven filtering)
25942
+ entity: _entity,
25943
+ filters,
25944
+ look = "right-aligned-buttons"
25945
+ }) => {
25946
+ const eventBus = useSafeEventBus3();
25947
+ const variantClasses2 = {
25948
+ default: "gap-0",
25949
+ segmented: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0",
25950
+ toggle: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0"
25951
+ };
25952
+ const orientationClasses = {
25953
+ horizontal: "flex-row",
25954
+ vertical: "flex-col [&>button:first-child]:rounded-t-lg [&>button:last-child]:rounded-b-lg [&>button:not(:first-child)]:border-t-0 [&>button:not(:first-child)]:border-l"
25955
+ };
25956
+ const handleActionClick = (action) => {
25957
+ if (action.event) {
25958
+ eventBus.emit("UI:DISPATCH", { event: action.event });
25959
+ }
25960
+ if (action.navigatesTo) {
25961
+ eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
25962
+ }
25963
+ };
25964
+ const renderFormActions = () => {
25965
+ const buttons = [];
25966
+ if (secondary) {
25967
+ secondary.forEach((action, index) => {
25968
+ buttons.push(
25969
+ /* @__PURE__ */ jsxRuntime.jsx(
25970
+ exports.Button,
25971
+ {
25972
+ type: action.actionType === "submit" ? "submit" : "button",
25973
+ variant: action.variant || "ghost",
25974
+ onClick: () => handleActionClick(action),
25975
+ children: action.label
25976
+ },
25977
+ `secondary-${index}`
25978
+ )
25979
+ );
25980
+ });
25981
+ }
25982
+ if (primary) {
25983
+ const isSubmit = primary.actionType === "submit";
25984
+ buttons.push(
25985
+ /* @__PURE__ */ jsxRuntime.jsx(
25986
+ exports.Button,
25987
+ {
25988
+ type: isSubmit ? "submit" : "button",
25989
+ variant: primary.variant || "primary",
25990
+ onClick: () => handleActionClick(primary),
25991
+ "data-testid": isSubmit ? "form-submit" : void 0,
25992
+ children: primary.label
25993
+ },
25994
+ "primary"
25995
+ )
25996
+ );
25997
+ }
25998
+ return buttons;
25999
+ };
26000
+ const renderFilters = () => {
26001
+ if (!filters || filters.length === 0) return null;
26002
+ return filters.map((filter, index) => /* @__PURE__ */ jsxRuntime.jsx(
26003
+ exports.Button,
26004
+ {
26005
+ variant: "ghost",
26006
+ onClick: () => {
26007
+ log6.debug("Filter clicked", { field: filter.field });
26008
+ },
26009
+ children: filter.label
26010
+ },
26011
+ `filter-${filter.field}-${index}`
26012
+ ));
26013
+ };
26014
+ return /* @__PURE__ */ jsxRuntime.jsx(
26015
+ "div",
26016
+ {
26017
+ className: cn(
26018
+ "inline-flex gap-2",
26019
+ variantClasses2[variant],
26020
+ orientationClasses[orientation],
26021
+ lookStyles5[look],
26022
+ className
26023
+ ),
26024
+ role: "group",
26025
+ children: children || renderFilters() || renderFormActions()
26026
+ }
26027
+ );
26028
+ };
26029
+ exports.ButtonGroup.displayName = "ButtonGroup";
26030
+ }
26031
+ });
26028
26032
  function getOrCreateStore(query) {
26029
26033
  if (!queryStores.has(query)) {
26030
26034
  queryStores.set(query, {
@@ -52821,7 +52825,6 @@ var init_component_registry_generated = __esm({
52821
52825
  init_BranchingLogicBuilder();
52822
52826
  init_Breadcrumb();
52823
52827
  init_BuilderBoard();
52824
- init_ButtonGroup();
52825
52828
  init_CTABanner();
52826
52829
  init_CalendarGrid();
52827
52830
  init_Canvas2D();
@@ -52898,9 +52901,9 @@ var init_component_registry_generated = __esm({
52898
52901
  init_FlipContainer();
52899
52902
  init_FloatingActionButton();
52900
52903
  init_Form();
52904
+ init_FormSection();
52901
52905
  init_FormField();
52902
52906
  init_FormSectionHeader();
52903
- init_GameAudioProvider();
52904
52907
  init_GameAudioToggle();
52905
52908
  init_GameCard();
52906
52909
  init_GameHud();
@@ -53149,7 +53152,6 @@ var init_component_registry_generated = __esm({
53149
53152
  "Breadcrumb": exports.Breadcrumb,
53150
53153
  "BuilderBoard": BuilderBoard,
53151
53154
  "Button": ButtonPattern,
53152
- "ButtonGroup": exports.ButtonGroup,
53153
53155
  "ButtonPattern": ButtonPattern,
53154
53156
  "CTABanner": exports.CTABanner,
53155
53157
  "CalendarGrid": CalendarGrid,
@@ -53229,9 +53231,10 @@ var init_component_registry_generated = __esm({
53229
53231
  "FlipContainer": exports.FlipContainer,
53230
53232
  "FloatingActionButton": exports.FloatingActionButton,
53231
53233
  "Form": exports.Form,
53234
+ "FormActions": exports.FormActions,
53232
53235
  "FormField": exports.FormField,
53236
+ "FormLayout": exports.FormLayout,
53233
53237
  "FormSectionHeader": exports.FormSectionHeader,
53234
- "GameAudioProvider": GameAudioProvider,
53235
53238
  "GameAudioToggle": GameAudioToggle,
53236
53239
  "GameBoard3D": GameBoard3D,
53237
53240
  "GameCanvas3D": GameCanvas3D,