@nesso-how/ui 1.0.0-beta.22 → 1.0.0-beta.23

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/README.md CHANGED
@@ -45,7 +45,7 @@ Your build must compile this CSS; it is not a precompiled stylesheet. Supply the
45
45
  | Search and suggestions | `Combobox`, `ComboboxItem`, `ComboboxPopup`, `Autocomplete`, `AutocompleteClear`, `AutocompleteItem`, `AutocompletePopup` |
46
46
  | Dialogs | `Dialog`, `DialogActions`, `DialogPopup`, `ConfirmDialog`, `TextPromptDialog`, `BottomSheet` |
47
47
  | Panels and disclosure | `SidePanel`, `PanelHeader`, `PluginPage`, `PluginContent`, `SectionHeading`, `Collapsible`, `Tabs` |
48
- | Feedback | `Banner`, `BannerRow`, `BannerDetails`, `ToastViewport`, `Spinner` |
48
+ | Feedback | `Banner`, `BannerRow`, `BannerDetails`, `ToastViewport`, `Spinner`, `CharacterLimitHint` |
49
49
  | Labels and icons | `Kbd`, `ContextLabel`, `ActionIcon` |
50
50
 
51
51
  `Button` supports `default`, `outline`, and `ghost` variants. `SidePanel` supports controlled resizing and collapse. `Spinner` accepts an accessible `label` and respects reduced motion. State, content, and event handling remain yours to provide.
package/dist/index.d.ts CHANGED
@@ -55,6 +55,16 @@ export declare function useMediaQuery(query: string): boolean;
55
55
  //#region src/input.d.ts
56
56
  declare function Input({ className, type, ...props }: ComponentProps<'input'>): import("react").JSX.Element;
57
57
  //#endregion
58
+ //#region src/character-limit-hint.d.ts
59
+ export declare function CharacterLimitHint({ id, length, maxLength, remainingText, limitText, className }: {
60
+ id: string;
61
+ length: number;
62
+ maxLength: number;
63
+ remainingText: (count: number) => string;
64
+ limitText: string;
65
+ className?: string;
66
+ }): import("react").JSX.Element;
67
+ //#endregion
58
68
  //#region src/directory-field.d.ts
59
69
  export declare function DirectoryField({ label, value, labels, disabled, changeDisabled, onOpen, onChange, onRestore }: {
60
70
  label: string;
package/dist/index.js CHANGED
@@ -237,6 +237,18 @@ function Input({ className, type, ...props }) {
237
237
  });
238
238
  }
239
239
  //#endregion
240
+ //#region src/character-limit-hint.tsx
241
+ function CharacterLimitHint({ id, length, maxLength, remainingText, limitText, className }) {
242
+ const remaining = Math.max(0, maxLength - length);
243
+ return /* @__PURE__ */ jsx("p", {
244
+ id,
245
+ role: "status",
246
+ "aria-atomic": "true",
247
+ className: remaining > 10 ? "sr-only" : cn("text-xs leading-4", remaining === 0 ? "text-foreground" : "text-muted-foreground", className),
248
+ children: remaining <= 10 ? remaining === 0 ? limitText : remainingText(remaining) : null
249
+ });
250
+ }
251
+ //#endregion
240
252
  //#region src/directory-field.tsx
241
253
  function DirectoryField({ label, value, labels, disabled, changeDisabled, onOpen, onChange, onRestore }) {
242
254
  const id = useId();
@@ -1683,4 +1695,4 @@ function ActionIcon({ name, ...props }) {
1683
1695
  });
1684
1696
  }
1685
1697
  //#endregion
1686
- export { ActionIcon, Autocomplete, AutocompleteClear, AutocompleteItem, AutocompletePopup, Banner, BannerDetails, BannerRow, BottomSheet, Button, Collapsible, ColorPicker, Combobox, ComboboxItem, ComboboxPopup, ConfirmDialog, ContextLabel, Dialog, DialogActions, DialogPopup, DirectoryField, Field, FieldHint, IconButton, Input, Kbd, Label, ListRow, ListRowButton, ListRowDetail, ListRowTitle, MarkdownInput, Menu, MenuItem, MenuPopup, MenuRadioItem, PanelHeader, PluginContent, PluginPage, Popover, PopoverPopup, PreferenceSelect, PromptForm, RevealActions, SectionHeading, SidePanel, Spinner, Tabs, TextPromptDialog, ToastViewport, conceptColor, useMediaQuery };
1698
+ export { ActionIcon, Autocomplete, AutocompleteClear, AutocompleteItem, AutocompletePopup, Banner, BannerDetails, BannerRow, BottomSheet, Button, CharacterLimitHint, Collapsible, ColorPicker, Combobox, ComboboxItem, ComboboxPopup, ConfirmDialog, ContextLabel, Dialog, DialogActions, DialogPopup, DirectoryField, Field, FieldHint, IconButton, Input, Kbd, Label, ListRow, ListRowButton, ListRowDetail, ListRowTitle, MarkdownInput, Menu, MenuItem, MenuPopup, MenuRadioItem, PanelHeader, PluginContent, PluginPage, Popover, PopoverPopup, PreferenceSelect, PromptForm, RevealActions, SectionHeading, SidePanel, Spinner, Tabs, TextPromptDialog, ToastViewport, conceptColor, useMediaQuery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nesso-how/ui",
3
- "version": "1.0.0-beta.22",
3
+ "version": "1.0.0-beta.23",
4
4
  "description": "Reusable React primitives and shared styles for Nesso, usable in the app and in isolated plugin panels",
5
5
  "license": "MIT",
6
6
  "repository": {