@nesso-how/ui 1.0.0-beta.7 → 1.0.0-beta.9

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
@@ -39,7 +39,7 @@ Your build must compile this CSS; it is not a precompiled stylesheet. Supply the
39
39
 
40
40
  | Area | Exports |
41
41
  | ---------------------- | ------------------------------------------------------------------------------------------------------------------------- |
42
- | Buttons and inputs | `Button`, `IconButton`, `Input`, `MarkdownInput`, `Label`, `PreferenceSelect`, `ColorPicker` |
42
+ | Buttons and inputs | `Button`, `IconButton`, `Input`, `DirectoryField`, `MarkdownInput`, `Label`, `PreferenceSelect`, `ColorPicker` |
43
43
  | Forms and rows | `Field`, `FieldHint`, `ListRow`, `ListRowButton`, `ListRowDetail`, `ListRowTitle`, `RevealActions`, `PromptForm` |
44
44
  | Menus and popovers | `Menu`, `MenuItem`, `MenuPopup`, `MenuRadioItem`, `Popover`, `PopoverPopup` |
45
45
  | Search and suggestions | `Combobox`, `ComboboxItem`, `ComboboxPopup`, `Autocomplete`, `AutocompleteClear`, `AutocompleteItem`, `AutocompletePopup` |
package/dist/index.d.ts CHANGED
@@ -55,6 +55,22 @@ 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/directory-field.d.ts
59
+ export declare function DirectoryField({ label, value, labels, disabled, changeDisabled, onOpen, onChange, onRestore }: {
60
+ label: string;
61
+ value?: string;
62
+ labels: {
63
+ open: string;
64
+ change: string;
65
+ restore: string;
66
+ };
67
+ disabled?: boolean;
68
+ changeDisabled?: boolean;
69
+ onOpen: () => void;
70
+ onChange: () => void;
71
+ onRestore?: () => void;
72
+ }): import("react").JSX.Element;
73
+ //#endregion
58
74
  //#region src/markdown-input.d.ts
59
75
  type MarkdownInputProps = Omit<ComponentProps<'div'>, 'onChange' | 'children' | 'defaultValue'> & {
60
76
  value: string;
package/dist/index.js CHANGED
@@ -237,6 +237,54 @@ function Input({ className, type, ...props }) {
237
237
  });
238
238
  }
239
239
  //#endregion
240
+ //#region src/directory-field.tsx
241
+ function DirectoryField({ label, value, labels, disabled, changeDisabled, onOpen, onChange, onRestore }) {
242
+ const id = useId();
243
+ return /* @__PURE__ */ jsxs("div", {
244
+ className: "mt-4",
245
+ children: [
246
+ /* @__PURE__ */ jsx("label", {
247
+ htmlFor: id,
248
+ className: "block text-xs",
249
+ children: label
250
+ }),
251
+ /* @__PURE__ */ jsxs("div", {
252
+ className: "mt-2 flex items-center gap-2",
253
+ children: [/* @__PURE__ */ jsxs("div", {
254
+ className: "relative min-w-0 flex-1",
255
+ children: [/* @__PURE__ */ jsx(Input, {
256
+ id,
257
+ className: "pr-10",
258
+ readOnly: true,
259
+ value: value ?? "",
260
+ title: value
261
+ }), /* @__PURE__ */ jsx(IconButton, {
262
+ className: "absolute top-1/2 right-1 -translate-y-1/2 text-muted-foreground",
263
+ "aria-label": labels.open,
264
+ title: labels.open,
265
+ disabled,
266
+ onClick: onOpen,
267
+ children: /* @__PURE__ */ jsx(Folder, { "aria-hidden": "true" })
268
+ })]
269
+ }), /* @__PURE__ */ jsx(Button, {
270
+ variant: "outline",
271
+ disabled: disabled || changeDisabled,
272
+ onClick: onChange,
273
+ children: labels.change
274
+ })]
275
+ }),
276
+ onRestore && /* @__PURE__ */ jsxs(Button, {
277
+ variant: "ghost",
278
+ size: "sm",
279
+ className: "mt-2",
280
+ disabled: disabled || changeDisabled,
281
+ onClick: onRestore,
282
+ children: [/* @__PURE__ */ jsx(RotateCcw, { "aria-hidden": "true" }), labels.restore]
283
+ })
284
+ ]
285
+ });
286
+ }
287
+ //#endregion
240
288
  //#region src/markdown.ts
241
289
  const listPrefix = /^(\s*)([-+*]|(\d{1,9})([.)]))([\t ]+|$)/;
242
290
  var ListMarker = class extends WidgetType {
@@ -1515,4 +1563,4 @@ function ActionIcon({ name, ...props }) {
1515
1563
  });
1516
1564
  }
1517
1565
  //#endregion
1518
- export { ActionIcon, Autocomplete, AutocompleteClear, AutocompleteItem, AutocompletePopup, Banner, BannerDetails, BannerRow, BottomSheet, Button, Collapsible, ColorPicker, Combobox, ComboboxItem, ComboboxPopup, ConfirmDialog, ContextLabel, Dialog, DialogActions, DialogPopup, 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, contrastColor, presetColors, useMediaQuery };
1566
+ 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, contrastColor, presetColors, useMediaQuery };
package/dist/styles.css CHANGED
@@ -526,6 +526,7 @@
526
526
  color: var(--muted-foreground);
527
527
  font-size: 12px;
528
528
  line-height: 18px;
529
+ white-space: pre-line;
529
530
  }
530
531
  .toast-actions {
531
532
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nesso-how/ui",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.9",
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": {