@almadar/ui 4.57.0 → 4.57.1

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.
@@ -13832,7 +13832,7 @@ var init_MapView = __esm({
13832
13832
  shadowSize: [41, 41]
13833
13833
  });
13834
13834
  L.Marker.prototype.options.icon = defaultIcon;
13835
- const { useEffect: useEffect88, useRef: useRef88, useCallback: useCallback128, useState: useState122 } = React96__namespace.default;
13835
+ const { useEffect: useEffect88, useRef: useRef88, useCallback: useCallback129, useState: useState123 } = React96__namespace.default;
13836
13836
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
13837
13837
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
13838
13838
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -13877,8 +13877,8 @@ var init_MapView = __esm({
13877
13877
  showAttribution = true
13878
13878
  }) {
13879
13879
  const eventBus = useEventBus3();
13880
- const [clickedPosition, setClickedPosition] = useState122(null);
13881
- const handleMapClick = useCallback128((lat, lng) => {
13880
+ const [clickedPosition, setClickedPosition] = useState123(null);
13881
+ const handleMapClick = useCallback129((lat, lng) => {
13882
13882
  if (showClickedPin) {
13883
13883
  setClickedPosition({ lat, lng });
13884
13884
  }
@@ -13887,7 +13887,7 @@ var init_MapView = __esm({
13887
13887
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
13888
13888
  }
13889
13889
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
13890
- const handleMarkerClick = useCallback128((marker) => {
13890
+ const handleMarkerClick = useCallback129((marker) => {
13891
13891
  onMarkerClick?.(marker);
13892
13892
  if (markerClickEvent) {
13893
13893
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -33304,6 +33304,98 @@ var init_TagCloud = __esm({
33304
33304
  TagCloud.displayName = "TagCloud";
33305
33305
  }
33306
33306
  });
33307
+ var TagInput;
33308
+ var init_TagInput = __esm({
33309
+ "components/molecules/TagInput.tsx"() {
33310
+ "use client";
33311
+ init_cn();
33312
+ init_useEventBus();
33313
+ init_Input();
33314
+ init_Badge();
33315
+ init_Stack();
33316
+ init_Typography();
33317
+ TagInput = ({
33318
+ value,
33319
+ onChange,
33320
+ placeholder,
33321
+ disabled = false,
33322
+ variant = "default",
33323
+ unique = true,
33324
+ helperText,
33325
+ className,
33326
+ addEvent,
33327
+ removeEvent
33328
+ }) => {
33329
+ const eventBus = useEventBus();
33330
+ const [draft, setDraft] = React96.useState("");
33331
+ const commit = React96.useCallback(() => {
33332
+ const tag = draft.trim();
33333
+ if (!tag) return;
33334
+ if (unique && value.includes(tag)) {
33335
+ setDraft("");
33336
+ return;
33337
+ }
33338
+ const next = [...value, tag];
33339
+ onChange?.(next);
33340
+ if (addEvent) {
33341
+ eventBus.emit(`UI:${addEvent}`, { tag, value: next });
33342
+ }
33343
+ setDraft("");
33344
+ }, [draft, value, onChange, unique, addEvent, eventBus]);
33345
+ const removeAt = React96.useCallback(
33346
+ (index) => {
33347
+ if (disabled) return;
33348
+ const tag = value[index];
33349
+ const next = value.slice();
33350
+ next.splice(index, 1);
33351
+ onChange?.(next);
33352
+ if (removeEvent) {
33353
+ eventBus.emit(`UI:${removeEvent}`, { tag, index, value: next });
33354
+ }
33355
+ },
33356
+ [value, onChange, disabled, removeEvent, eventBus]
33357
+ );
33358
+ const handleKeyDown = React96.useCallback(
33359
+ (e) => {
33360
+ if (disabled) return;
33361
+ if (e.key === "Enter") {
33362
+ e.preventDefault();
33363
+ commit();
33364
+ } else if (e.key === "Backspace" && draft.length === 0 && value.length > 0) {
33365
+ e.preventDefault();
33366
+ removeAt(value.length - 1);
33367
+ }
33368
+ },
33369
+ [commit, draft.length, value, removeAt, disabled]
33370
+ );
33371
+ return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: cn("w-full", className), children: [
33372
+ value.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-wrap", children: value.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsx(
33373
+ Badge,
33374
+ {
33375
+ variant,
33376
+ size: "sm",
33377
+ onRemove: disabled ? void 0 : () => removeAt(index),
33378
+ removeLabel: `Remove ${tag}`,
33379
+ children: tag
33380
+ },
33381
+ `${tag}-${index}`
33382
+ )) }) : null,
33383
+ /* @__PURE__ */ jsxRuntime.jsx(
33384
+ Input,
33385
+ {
33386
+ value: draft,
33387
+ placeholder: placeholder ?? "Type and press Enter\u2026",
33388
+ disabled,
33389
+ onChange: (e) => setDraft(e.target.value),
33390
+ onKeyDown: handleKeyDown
33391
+ }
33392
+ ),
33393
+ helperText ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "muted", children: helperText }) : null
33394
+ ] });
33395
+ };
33396
+ TagInput.displayName = "TagInput";
33397
+ }
33398
+ });
33307
33399
  var ShowcaseCard;
33308
33400
  var init_ShowcaseCard = __esm({
33309
33401
  "components/molecules/ShowcaseCard.tsx"() {
@@ -53862,6 +53954,7 @@ var init_component_registry_generated = __esm({
53862
53954
  init_Table();
53863
53955
  init_Tabs();
53864
53956
  init_TagCloud();
53957
+ init_TagInput();
53865
53958
  init_TeamCard();
53866
53959
  init_TeamOrganism();
53867
53960
  init_TextHighlight();
@@ -54177,6 +54270,7 @@ var init_component_registry_generated = __esm({
54177
54270
  "Table": Table,
54178
54271
  "Tabs": Tabs,
54179
54272
  "TagCloud": TagCloud,
54273
+ "TagInput": TagInput,
54180
54274
  "TeamCard": TeamCard,
54181
54275
  "TeamOrganism": TeamOrganism,
54182
54276
  "TextHighlight": TextHighlight,
package/dist/avl/index.js CHANGED
@@ -13786,7 +13786,7 @@ var init_MapView = __esm({
13786
13786
  shadowSize: [41, 41]
13787
13787
  });
13788
13788
  L.Marker.prototype.options.icon = defaultIcon;
13789
- const { useEffect: useEffect88, useRef: useRef88, useCallback: useCallback128, useState: useState122 } = React96__default;
13789
+ const { useEffect: useEffect88, useRef: useRef88, useCallback: useCallback129, useState: useState123 } = React96__default;
13790
13790
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
13791
13791
  const { useEventBus: useEventBus3 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
13792
13792
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -13831,8 +13831,8 @@ var init_MapView = __esm({
13831
13831
  showAttribution = true
13832
13832
  }) {
13833
13833
  const eventBus = useEventBus3();
13834
- const [clickedPosition, setClickedPosition] = useState122(null);
13835
- const handleMapClick = useCallback128((lat, lng) => {
13834
+ const [clickedPosition, setClickedPosition] = useState123(null);
13835
+ const handleMapClick = useCallback129((lat, lng) => {
13836
13836
  if (showClickedPin) {
13837
13837
  setClickedPosition({ lat, lng });
13838
13838
  }
@@ -13841,7 +13841,7 @@ var init_MapView = __esm({
13841
13841
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
13842
13842
  }
13843
13843
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
13844
- const handleMarkerClick = useCallback128((marker) => {
13844
+ const handleMarkerClick = useCallback129((marker) => {
13845
13845
  onMarkerClick?.(marker);
13846
13846
  if (markerClickEvent) {
13847
13847
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -33258,6 +33258,98 @@ var init_TagCloud = __esm({
33258
33258
  TagCloud.displayName = "TagCloud";
33259
33259
  }
33260
33260
  });
33261
+ var TagInput;
33262
+ var init_TagInput = __esm({
33263
+ "components/molecules/TagInput.tsx"() {
33264
+ "use client";
33265
+ init_cn();
33266
+ init_useEventBus();
33267
+ init_Input();
33268
+ init_Badge();
33269
+ init_Stack();
33270
+ init_Typography();
33271
+ TagInput = ({
33272
+ value,
33273
+ onChange,
33274
+ placeholder,
33275
+ disabled = false,
33276
+ variant = "default",
33277
+ unique = true,
33278
+ helperText,
33279
+ className,
33280
+ addEvent,
33281
+ removeEvent
33282
+ }) => {
33283
+ const eventBus = useEventBus();
33284
+ const [draft, setDraft] = useState("");
33285
+ const commit = useCallback(() => {
33286
+ const tag = draft.trim();
33287
+ if (!tag) return;
33288
+ if (unique && value.includes(tag)) {
33289
+ setDraft("");
33290
+ return;
33291
+ }
33292
+ const next = [...value, tag];
33293
+ onChange?.(next);
33294
+ if (addEvent) {
33295
+ eventBus.emit(`UI:${addEvent}`, { tag, value: next });
33296
+ }
33297
+ setDraft("");
33298
+ }, [draft, value, onChange, unique, addEvent, eventBus]);
33299
+ const removeAt = useCallback(
33300
+ (index) => {
33301
+ if (disabled) return;
33302
+ const tag = value[index];
33303
+ const next = value.slice();
33304
+ next.splice(index, 1);
33305
+ onChange?.(next);
33306
+ if (removeEvent) {
33307
+ eventBus.emit(`UI:${removeEvent}`, { tag, index, value: next });
33308
+ }
33309
+ },
33310
+ [value, onChange, disabled, removeEvent, eventBus]
33311
+ );
33312
+ const handleKeyDown = useCallback(
33313
+ (e) => {
33314
+ if (disabled) return;
33315
+ if (e.key === "Enter") {
33316
+ e.preventDefault();
33317
+ commit();
33318
+ } else if (e.key === "Backspace" && draft.length === 0 && value.length > 0) {
33319
+ e.preventDefault();
33320
+ removeAt(value.length - 1);
33321
+ }
33322
+ },
33323
+ [commit, draft.length, value, removeAt, disabled]
33324
+ );
33325
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: cn("w-full", className), children: [
33326
+ value.length > 0 ? /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: value.map((tag, index) => /* @__PURE__ */ jsx(
33327
+ Badge,
33328
+ {
33329
+ variant,
33330
+ size: "sm",
33331
+ onRemove: disabled ? void 0 : () => removeAt(index),
33332
+ removeLabel: `Remove ${tag}`,
33333
+ children: tag
33334
+ },
33335
+ `${tag}-${index}`
33336
+ )) }) : null,
33337
+ /* @__PURE__ */ jsx(
33338
+ Input,
33339
+ {
33340
+ value: draft,
33341
+ placeholder: placeholder ?? "Type and press Enter\u2026",
33342
+ disabled,
33343
+ onChange: (e) => setDraft(e.target.value),
33344
+ onKeyDown: handleKeyDown
33345
+ }
33346
+ ),
33347
+ helperText ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: helperText }) : null
33348
+ ] });
33349
+ };
33350
+ TagInput.displayName = "TagInput";
33351
+ }
33352
+ });
33261
33353
  var ShowcaseCard;
33262
33354
  var init_ShowcaseCard = __esm({
33263
33355
  "components/molecules/ShowcaseCard.tsx"() {
@@ -53816,6 +53908,7 @@ var init_component_registry_generated = __esm({
53816
53908
  init_Table();
53817
53909
  init_Tabs();
53818
53910
  init_TagCloud();
53911
+ init_TagInput();
53819
53912
  init_TeamCard();
53820
53913
  init_TeamOrganism();
53821
53914
  init_TextHighlight();
@@ -54131,6 +54224,7 @@ var init_component_registry_generated = __esm({
54131
54224
  "Table": Table,
54132
54225
  "Tabs": Tabs,
54133
54226
  "TagCloud": TagCloud,
54227
+ "TagInput": TagInput,
54134
54228
  "TeamCard": TeamCard,
54135
54229
  "TeamOrganism": TeamOrganism,
54136
54230
  "TextHighlight": TextHighlight,
@@ -44941,6 +44941,7 @@ var init_component_registry_generated = __esm({
44941
44941
  init_Table();
44942
44942
  init_Tabs();
44943
44943
  init_TagCloud();
44944
+ init_TagInput();
44944
44945
  init_TeamCard();
44945
44946
  init_TeamOrganism();
44946
44947
  init_TextHighlight();
@@ -45256,6 +45257,7 @@ var init_component_registry_generated = __esm({
45256
45257
  "Table": exports.Table,
45257
45258
  "Tabs": exports.Tabs,
45258
45259
  "TagCloud": exports.TagCloud,
45260
+ "TagInput": exports.TagInput,
45259
45261
  "TeamCard": exports.TeamCard,
45260
45262
  "TeamOrganism": exports.TeamOrganism,
45261
45263
  "TextHighlight": exports.TextHighlight,
@@ -44895,6 +44895,7 @@ var init_component_registry_generated = __esm({
44895
44895
  init_Table();
44896
44896
  init_Tabs();
44897
44897
  init_TagCloud();
44898
+ init_TagInput();
44898
44899
  init_TeamCard();
44899
44900
  init_TeamOrganism();
44900
44901
  init_TextHighlight();
@@ -45210,6 +45211,7 @@ var init_component_registry_generated = __esm({
45210
45211
  "Table": Table,
45211
45212
  "Tabs": Tabs,
45212
45213
  "TagCloud": TagCloud,
45214
+ "TagInput": TagInput,
45213
45215
  "TeamCard": TeamCard,
45214
45216
  "TeamOrganism": TeamOrganism,
45215
45217
  "TextHighlight": TextHighlight,
@@ -9457,7 +9457,7 @@ var init_MapView = __esm({
9457
9457
  shadowSize: [41, 41]
9458
9458
  });
9459
9459
  L.Marker.prototype.options.icon = defaultIcon;
9460
- const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback112, useState: useState97 } = React84__namespace.default;
9460
+ const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback113, useState: useState98 } = React84__namespace.default;
9461
9461
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9462
9462
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9463
9463
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -9502,8 +9502,8 @@ var init_MapView = __esm({
9502
9502
  showAttribution = true
9503
9503
  }) {
9504
9504
  const eventBus = useEventBus2();
9505
- const [clickedPosition, setClickedPosition] = useState97(null);
9506
- const handleMapClick = useCallback112((lat, lng) => {
9505
+ const [clickedPosition, setClickedPosition] = useState98(null);
9506
+ const handleMapClick = useCallback113((lat, lng) => {
9507
9507
  if (showClickedPin) {
9508
9508
  setClickedPosition({ lat, lng });
9509
9509
  }
@@ -9512,7 +9512,7 @@ var init_MapView = __esm({
9512
9512
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9513
9513
  }
9514
9514
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9515
- const handleMarkerClick = useCallback112((marker) => {
9515
+ const handleMarkerClick = useCallback113((marker) => {
9516
9516
  onMarkerClick?.(marker);
9517
9517
  if (markerClickEvent) {
9518
9518
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -29716,6 +29716,98 @@ var init_TagCloud = __esm({
29716
29716
  TagCloud.displayName = "TagCloud";
29717
29717
  }
29718
29718
  });
29719
+ var TagInput;
29720
+ var init_TagInput = __esm({
29721
+ "components/molecules/TagInput.tsx"() {
29722
+ "use client";
29723
+ init_cn();
29724
+ init_useEventBus();
29725
+ init_Input();
29726
+ init_Badge();
29727
+ init_Stack();
29728
+ init_Typography();
29729
+ TagInput = ({
29730
+ value,
29731
+ onChange,
29732
+ placeholder,
29733
+ disabled = false,
29734
+ variant = "default",
29735
+ unique = true,
29736
+ helperText,
29737
+ className,
29738
+ addEvent,
29739
+ removeEvent
29740
+ }) => {
29741
+ const eventBus = useEventBus();
29742
+ const [draft, setDraft] = React84.useState("");
29743
+ const commit = React84.useCallback(() => {
29744
+ const tag = draft.trim();
29745
+ if (!tag) return;
29746
+ if (unique && value.includes(tag)) {
29747
+ setDraft("");
29748
+ return;
29749
+ }
29750
+ const next = [...value, tag];
29751
+ onChange?.(next);
29752
+ if (addEvent) {
29753
+ eventBus.emit(`UI:${addEvent}`, { tag, value: next });
29754
+ }
29755
+ setDraft("");
29756
+ }, [draft, value, onChange, unique, addEvent, eventBus]);
29757
+ const removeAt = React84.useCallback(
29758
+ (index) => {
29759
+ if (disabled) return;
29760
+ const tag = value[index];
29761
+ const next = value.slice();
29762
+ next.splice(index, 1);
29763
+ onChange?.(next);
29764
+ if (removeEvent) {
29765
+ eventBus.emit(`UI:${removeEvent}`, { tag, index, value: next });
29766
+ }
29767
+ },
29768
+ [value, onChange, disabled, removeEvent, eventBus]
29769
+ );
29770
+ const handleKeyDown = React84.useCallback(
29771
+ (e) => {
29772
+ if (disabled) return;
29773
+ if (e.key === "Enter") {
29774
+ e.preventDefault();
29775
+ commit();
29776
+ } else if (e.key === "Backspace" && draft.length === 0 && value.length > 0) {
29777
+ e.preventDefault();
29778
+ removeAt(value.length - 1);
29779
+ }
29780
+ },
29781
+ [commit, draft.length, value, removeAt, disabled]
29782
+ );
29783
+ return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: cn("w-full", className), children: [
29784
+ value.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-wrap", children: value.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsx(
29785
+ Badge,
29786
+ {
29787
+ variant,
29788
+ size: "sm",
29789
+ onRemove: disabled ? void 0 : () => removeAt(index),
29790
+ removeLabel: `Remove ${tag}`,
29791
+ children: tag
29792
+ },
29793
+ `${tag}-${index}`
29794
+ )) }) : null,
29795
+ /* @__PURE__ */ jsxRuntime.jsx(
29796
+ Input,
29797
+ {
29798
+ value: draft,
29799
+ placeholder: placeholder ?? "Type and press Enter\u2026",
29800
+ disabled,
29801
+ onChange: (e) => setDraft(e.target.value),
29802
+ onKeyDown: handleKeyDown
29803
+ }
29804
+ ),
29805
+ helperText ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "muted", children: helperText }) : null
29806
+ ] });
29807
+ };
29808
+ TagInput.displayName = "TagInput";
29809
+ }
29810
+ });
29719
29811
  var ShowcaseCard;
29720
29812
  var init_ShowcaseCard = __esm({
29721
29813
  "components/molecules/ShowcaseCard.tsx"() {
@@ -45169,6 +45261,7 @@ var init_component_registry_generated = __esm({
45169
45261
  init_Table();
45170
45262
  init_Tabs();
45171
45263
  init_TagCloud();
45264
+ init_TagInput();
45172
45265
  init_TeamCard();
45173
45266
  init_TeamOrganism();
45174
45267
  init_TextHighlight();
@@ -45484,6 +45577,7 @@ var init_component_registry_generated = __esm({
45484
45577
  "Table": Table,
45485
45578
  "Tabs": Tabs,
45486
45579
  "TagCloud": TagCloud,
45580
+ "TagInput": TagInput,
45487
45581
  "TeamCard": TeamCard,
45488
45582
  "TeamOrganism": TeamOrganism,
45489
45583
  "TextHighlight": TextHighlight,
@@ -9411,7 +9411,7 @@ var init_MapView = __esm({
9411
9411
  shadowSize: [41, 41]
9412
9412
  });
9413
9413
  L.Marker.prototype.options.icon = defaultIcon;
9414
- const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback112, useState: useState97 } = React84__default;
9414
+ const { useEffect: useEffect68, useRef: useRef65, useCallback: useCallback113, useState: useState98 } = React84__default;
9415
9415
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9416
9416
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9417
9417
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -9456,8 +9456,8 @@ var init_MapView = __esm({
9456
9456
  showAttribution = true
9457
9457
  }) {
9458
9458
  const eventBus = useEventBus2();
9459
- const [clickedPosition, setClickedPosition] = useState97(null);
9460
- const handleMapClick = useCallback112((lat, lng) => {
9459
+ const [clickedPosition, setClickedPosition] = useState98(null);
9460
+ const handleMapClick = useCallback113((lat, lng) => {
9461
9461
  if (showClickedPin) {
9462
9462
  setClickedPosition({ lat, lng });
9463
9463
  }
@@ -9466,7 +9466,7 @@ var init_MapView = __esm({
9466
9466
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9467
9467
  }
9468
9468
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9469
- const handleMarkerClick = useCallback112((marker) => {
9469
+ const handleMarkerClick = useCallback113((marker) => {
9470
9470
  onMarkerClick?.(marker);
9471
9471
  if (markerClickEvent) {
9472
9472
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -29670,6 +29670,98 @@ var init_TagCloud = __esm({
29670
29670
  TagCloud.displayName = "TagCloud";
29671
29671
  }
29672
29672
  });
29673
+ var TagInput;
29674
+ var init_TagInput = __esm({
29675
+ "components/molecules/TagInput.tsx"() {
29676
+ "use client";
29677
+ init_cn();
29678
+ init_useEventBus();
29679
+ init_Input();
29680
+ init_Badge();
29681
+ init_Stack();
29682
+ init_Typography();
29683
+ TagInput = ({
29684
+ value,
29685
+ onChange,
29686
+ placeholder,
29687
+ disabled = false,
29688
+ variant = "default",
29689
+ unique = true,
29690
+ helperText,
29691
+ className,
29692
+ addEvent,
29693
+ removeEvent
29694
+ }) => {
29695
+ const eventBus = useEventBus();
29696
+ const [draft, setDraft] = useState("");
29697
+ const commit = useCallback(() => {
29698
+ const tag = draft.trim();
29699
+ if (!tag) return;
29700
+ if (unique && value.includes(tag)) {
29701
+ setDraft("");
29702
+ return;
29703
+ }
29704
+ const next = [...value, tag];
29705
+ onChange?.(next);
29706
+ if (addEvent) {
29707
+ eventBus.emit(`UI:${addEvent}`, { tag, value: next });
29708
+ }
29709
+ setDraft("");
29710
+ }, [draft, value, onChange, unique, addEvent, eventBus]);
29711
+ const removeAt = useCallback(
29712
+ (index) => {
29713
+ if (disabled) return;
29714
+ const tag = value[index];
29715
+ const next = value.slice();
29716
+ next.splice(index, 1);
29717
+ onChange?.(next);
29718
+ if (removeEvent) {
29719
+ eventBus.emit(`UI:${removeEvent}`, { tag, index, value: next });
29720
+ }
29721
+ },
29722
+ [value, onChange, disabled, removeEvent, eventBus]
29723
+ );
29724
+ const handleKeyDown = useCallback(
29725
+ (e) => {
29726
+ if (disabled) return;
29727
+ if (e.key === "Enter") {
29728
+ e.preventDefault();
29729
+ commit();
29730
+ } else if (e.key === "Backspace" && draft.length === 0 && value.length > 0) {
29731
+ e.preventDefault();
29732
+ removeAt(value.length - 1);
29733
+ }
29734
+ },
29735
+ [commit, draft.length, value, removeAt, disabled]
29736
+ );
29737
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: cn("w-full", className), children: [
29738
+ value.length > 0 ? /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: value.map((tag, index) => /* @__PURE__ */ jsx(
29739
+ Badge,
29740
+ {
29741
+ variant,
29742
+ size: "sm",
29743
+ onRemove: disabled ? void 0 : () => removeAt(index),
29744
+ removeLabel: `Remove ${tag}`,
29745
+ children: tag
29746
+ },
29747
+ `${tag}-${index}`
29748
+ )) }) : null,
29749
+ /* @__PURE__ */ jsx(
29750
+ Input,
29751
+ {
29752
+ value: draft,
29753
+ placeholder: placeholder ?? "Type and press Enter\u2026",
29754
+ disabled,
29755
+ onChange: (e) => setDraft(e.target.value),
29756
+ onKeyDown: handleKeyDown
29757
+ }
29758
+ ),
29759
+ helperText ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: helperText }) : null
29760
+ ] });
29761
+ };
29762
+ TagInput.displayName = "TagInput";
29763
+ }
29764
+ });
29673
29765
  var ShowcaseCard;
29674
29766
  var init_ShowcaseCard = __esm({
29675
29767
  "components/molecules/ShowcaseCard.tsx"() {
@@ -45123,6 +45215,7 @@ var init_component_registry_generated = __esm({
45123
45215
  init_Table();
45124
45216
  init_Tabs();
45125
45217
  init_TagCloud();
45218
+ init_TagInput();
45126
45219
  init_TeamCard();
45127
45220
  init_TeamOrganism();
45128
45221
  init_TextHighlight();
@@ -45438,6 +45531,7 @@ var init_component_registry_generated = __esm({
45438
45531
  "Table": Table,
45439
45532
  "Tabs": Tabs,
45440
45533
  "TagCloud": TagCloud,
45534
+ "TagInput": TagInput,
45441
45535
  "TeamCard": TeamCard,
45442
45536
  "TeamOrganism": TeamOrganism,
45443
45537
  "TextHighlight": TextHighlight,
@@ -9345,7 +9345,7 @@ var init_MapView = __esm({
9345
9345
  shadowSize: [41, 41]
9346
9346
  });
9347
9347
  L.Marker.prototype.options.icon = defaultIcon;
9348
- const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback112, useState: useState100 } = React83__namespace.default;
9348
+ const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback113, useState: useState101 } = React83__namespace.default;
9349
9349
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9350
9350
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9351
9351
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -9390,8 +9390,8 @@ var init_MapView = __esm({
9390
9390
  showAttribution = true
9391
9391
  }) {
9392
9392
  const eventBus = useEventBus2();
9393
- const [clickedPosition, setClickedPosition] = useState100(null);
9394
- const handleMapClick = useCallback112((lat, lng) => {
9393
+ const [clickedPosition, setClickedPosition] = useState101(null);
9394
+ const handleMapClick = useCallback113((lat, lng) => {
9395
9395
  if (showClickedPin) {
9396
9396
  setClickedPosition({ lat, lng });
9397
9397
  }
@@ -9400,7 +9400,7 @@ var init_MapView = __esm({
9400
9400
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9401
9401
  }
9402
9402
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9403
- const handleMarkerClick = useCallback112((marker) => {
9403
+ const handleMarkerClick = useCallback113((marker) => {
9404
9404
  onMarkerClick?.(marker);
9405
9405
  if (markerClickEvent) {
9406
9406
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -29283,6 +29283,98 @@ var init_TagCloud = __esm({
29283
29283
  TagCloud.displayName = "TagCloud";
29284
29284
  }
29285
29285
  });
29286
+ var TagInput;
29287
+ var init_TagInput = __esm({
29288
+ "components/molecules/TagInput.tsx"() {
29289
+ "use client";
29290
+ init_cn();
29291
+ init_useEventBus();
29292
+ init_Input();
29293
+ init_Badge();
29294
+ init_Stack();
29295
+ init_Typography();
29296
+ TagInput = ({
29297
+ value,
29298
+ onChange,
29299
+ placeholder,
29300
+ disabled = false,
29301
+ variant = "default",
29302
+ unique = true,
29303
+ helperText,
29304
+ className,
29305
+ addEvent,
29306
+ removeEvent
29307
+ }) => {
29308
+ const eventBus = useEventBus();
29309
+ const [draft, setDraft] = React83.useState("");
29310
+ const commit = React83.useCallback(() => {
29311
+ const tag = draft.trim();
29312
+ if (!tag) return;
29313
+ if (unique && value.includes(tag)) {
29314
+ setDraft("");
29315
+ return;
29316
+ }
29317
+ const next = [...value, tag];
29318
+ onChange?.(next);
29319
+ if (addEvent) {
29320
+ eventBus.emit(`UI:${addEvent}`, { tag, value: next });
29321
+ }
29322
+ setDraft("");
29323
+ }, [draft, value, onChange, unique, addEvent, eventBus]);
29324
+ const removeAt = React83.useCallback(
29325
+ (index) => {
29326
+ if (disabled) return;
29327
+ const tag = value[index];
29328
+ const next = value.slice();
29329
+ next.splice(index, 1);
29330
+ onChange?.(next);
29331
+ if (removeEvent) {
29332
+ eventBus.emit(`UI:${removeEvent}`, { tag, index, value: next });
29333
+ }
29334
+ },
29335
+ [value, onChange, disabled, removeEvent, eventBus]
29336
+ );
29337
+ const handleKeyDown = React83.useCallback(
29338
+ (e) => {
29339
+ if (disabled) return;
29340
+ if (e.key === "Enter") {
29341
+ e.preventDefault();
29342
+ commit();
29343
+ } else if (e.key === "Backspace" && draft.length === 0 && value.length > 0) {
29344
+ e.preventDefault();
29345
+ removeAt(value.length - 1);
29346
+ }
29347
+ },
29348
+ [commit, draft.length, value, removeAt, disabled]
29349
+ );
29350
+ return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: cn("w-full", className), children: [
29351
+ value.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "flex-wrap", children: value.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsx(
29352
+ Badge,
29353
+ {
29354
+ variant,
29355
+ size: "sm",
29356
+ onRemove: disabled ? void 0 : () => removeAt(index),
29357
+ removeLabel: `Remove ${tag}`,
29358
+ children: tag
29359
+ },
29360
+ `${tag}-${index}`
29361
+ )) }) : null,
29362
+ /* @__PURE__ */ jsxRuntime.jsx(
29363
+ Input,
29364
+ {
29365
+ value: draft,
29366
+ placeholder: placeholder ?? "Type and press Enter\u2026",
29367
+ disabled,
29368
+ onChange: (e) => setDraft(e.target.value),
29369
+ onKeyDown: handleKeyDown
29370
+ }
29371
+ ),
29372
+ helperText ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", color: "muted", children: helperText }) : null
29373
+ ] });
29374
+ };
29375
+ TagInput.displayName = "TagInput";
29376
+ }
29377
+ });
29286
29378
  var ShowcaseCard;
29287
29379
  var init_ShowcaseCard = __esm({
29288
29380
  "components/molecules/ShowcaseCard.tsx"() {
@@ -44755,6 +44847,7 @@ var init_component_registry_generated = __esm({
44755
44847
  init_Table();
44756
44848
  init_Tabs();
44757
44849
  init_TagCloud();
44850
+ init_TagInput();
44758
44851
  init_TeamCard();
44759
44852
  init_TeamOrganism();
44760
44853
  init_TextHighlight();
@@ -45070,6 +45163,7 @@ var init_component_registry_generated = __esm({
45070
45163
  "Table": Table,
45071
45164
  "Tabs": Tabs,
45072
45165
  "TagCloud": TagCloud,
45166
+ "TagInput": TagInput,
45073
45167
  "TeamCard": TeamCard,
45074
45168
  "TeamOrganism": TeamOrganism,
45075
45169
  "TextHighlight": TextHighlight,
@@ -9299,7 +9299,7 @@ var init_MapView = __esm({
9299
9299
  shadowSize: [41, 41]
9300
9300
  });
9301
9301
  L.Marker.prototype.options.icon = defaultIcon;
9302
- const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback112, useState: useState100 } = React83__default;
9302
+ const { useEffect: useEffect69, useRef: useRef65, useCallback: useCallback113, useState: useState101 } = React83__default;
9303
9303
  const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
9304
9304
  const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
9305
9305
  function MapUpdater({ centerLat, centerLng, zoom }) {
@@ -9344,8 +9344,8 @@ var init_MapView = __esm({
9344
9344
  showAttribution = true
9345
9345
  }) {
9346
9346
  const eventBus = useEventBus2();
9347
- const [clickedPosition, setClickedPosition] = useState100(null);
9348
- const handleMapClick = useCallback112((lat, lng) => {
9347
+ const [clickedPosition, setClickedPosition] = useState101(null);
9348
+ const handleMapClick = useCallback113((lat, lng) => {
9349
9349
  if (showClickedPin) {
9350
9350
  setClickedPosition({ lat, lng });
9351
9351
  }
@@ -9354,7 +9354,7 @@ var init_MapView = __esm({
9354
9354
  eventBus.emit(`UI:${mapClickEvent}`, { latitude: lat, longitude: lng });
9355
9355
  }
9356
9356
  }, [onMapClick, mapClickEvent, eventBus, showClickedPin]);
9357
- const handleMarkerClick = useCallback112((marker) => {
9357
+ const handleMarkerClick = useCallback113((marker) => {
9358
9358
  onMarkerClick?.(marker);
9359
9359
  if (markerClickEvent) {
9360
9360
  eventBus.emit(`UI:${markerClickEvent}`, { ...marker });
@@ -29237,6 +29237,98 @@ var init_TagCloud = __esm({
29237
29237
  TagCloud.displayName = "TagCloud";
29238
29238
  }
29239
29239
  });
29240
+ var TagInput;
29241
+ var init_TagInput = __esm({
29242
+ "components/molecules/TagInput.tsx"() {
29243
+ "use client";
29244
+ init_cn();
29245
+ init_useEventBus();
29246
+ init_Input();
29247
+ init_Badge();
29248
+ init_Stack();
29249
+ init_Typography();
29250
+ TagInput = ({
29251
+ value,
29252
+ onChange,
29253
+ placeholder,
29254
+ disabled = false,
29255
+ variant = "default",
29256
+ unique = true,
29257
+ helperText,
29258
+ className,
29259
+ addEvent,
29260
+ removeEvent
29261
+ }) => {
29262
+ const eventBus = useEventBus();
29263
+ const [draft, setDraft] = useState("");
29264
+ const commit = useCallback(() => {
29265
+ const tag = draft.trim();
29266
+ if (!tag) return;
29267
+ if (unique && value.includes(tag)) {
29268
+ setDraft("");
29269
+ return;
29270
+ }
29271
+ const next = [...value, tag];
29272
+ onChange?.(next);
29273
+ if (addEvent) {
29274
+ eventBus.emit(`UI:${addEvent}`, { tag, value: next });
29275
+ }
29276
+ setDraft("");
29277
+ }, [draft, value, onChange, unique, addEvent, eventBus]);
29278
+ const removeAt = useCallback(
29279
+ (index) => {
29280
+ if (disabled) return;
29281
+ const tag = value[index];
29282
+ const next = value.slice();
29283
+ next.splice(index, 1);
29284
+ onChange?.(next);
29285
+ if (removeEvent) {
29286
+ eventBus.emit(`UI:${removeEvent}`, { tag, index, value: next });
29287
+ }
29288
+ },
29289
+ [value, onChange, disabled, removeEvent, eventBus]
29290
+ );
29291
+ const handleKeyDown = useCallback(
29292
+ (e) => {
29293
+ if (disabled) return;
29294
+ if (e.key === "Enter") {
29295
+ e.preventDefault();
29296
+ commit();
29297
+ } else if (e.key === "Backspace" && draft.length === 0 && value.length > 0) {
29298
+ e.preventDefault();
29299
+ removeAt(value.length - 1);
29300
+ }
29301
+ },
29302
+ [commit, draft.length, value, removeAt, disabled]
29303
+ );
29304
+ return /* @__PURE__ */ jsxs(VStack, { gap: "xs", className: cn("w-full", className), children: [
29305
+ value.length > 0 ? /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-wrap", children: value.map((tag, index) => /* @__PURE__ */ jsx(
29306
+ Badge,
29307
+ {
29308
+ variant,
29309
+ size: "sm",
29310
+ onRemove: disabled ? void 0 : () => removeAt(index),
29311
+ removeLabel: `Remove ${tag}`,
29312
+ children: tag
29313
+ },
29314
+ `${tag}-${index}`
29315
+ )) }) : null,
29316
+ /* @__PURE__ */ jsx(
29317
+ Input,
29318
+ {
29319
+ value: draft,
29320
+ placeholder: placeholder ?? "Type and press Enter\u2026",
29321
+ disabled,
29322
+ onChange: (e) => setDraft(e.target.value),
29323
+ onKeyDown: handleKeyDown
29324
+ }
29325
+ ),
29326
+ helperText ? /* @__PURE__ */ jsx(Typography, { variant: "caption", color: "muted", children: helperText }) : null
29327
+ ] });
29328
+ };
29329
+ TagInput.displayName = "TagInput";
29330
+ }
29331
+ });
29240
29332
  var ShowcaseCard;
29241
29333
  var init_ShowcaseCard = __esm({
29242
29334
  "components/molecules/ShowcaseCard.tsx"() {
@@ -44709,6 +44801,7 @@ var init_component_registry_generated = __esm({
44709
44801
  init_Table();
44710
44802
  init_Tabs();
44711
44803
  init_TagCloud();
44804
+ init_TagInput();
44712
44805
  init_TeamCard();
44713
44806
  init_TeamOrganism();
44714
44807
  init_TextHighlight();
@@ -45024,6 +45117,7 @@ var init_component_registry_generated = __esm({
45024
45117
  "Table": Table,
45025
45118
  "Tabs": Tabs,
45026
45119
  "TagCloud": TagCloud,
45120
+ "TagInput": TagInput,
45027
45121
  "TeamCard": TeamCard,
45028
45122
  "TeamOrganism": TeamOrganism,
45029
45123
  "TextHighlight": TextHighlight,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.57.0",
3
+ "version": "4.57.1",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [