@journ/nude 0.1.1 → 0.1.3

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 (145) hide show
  1. package/dist/accordion-parts.d.ts +6 -5
  2. package/dist/accordion.d.ts +4 -4
  3. package/dist/alert-dialog-parts.d.ts +9 -8
  4. package/dist/alert-dialog.d.ts +10 -9
  5. package/dist/alert.d.ts +13 -6
  6. package/dist/animated-size.d.ts +3 -3
  7. package/dist/animated-size.js +1 -1
  8. package/dist/avatar-parts.d.ts +5 -4
  9. package/dist/avatar.d.ts +3 -3
  10. package/dist/badge.d.ts +2 -1
  11. package/dist/breadcrumbs.d.ts +13 -6
  12. package/dist/bulk-bar.d.ts +8 -3
  13. package/dist/button.d.ts +4 -4
  14. package/dist/calendar-parts.d.ts +23 -26
  15. package/dist/calendar-parts.js +5 -3
  16. package/dist/card.d.ts +15 -7
  17. package/dist/carousel-parts.d.ts +20 -11
  18. package/dist/carousel-parts.js +3 -2
  19. package/dist/checkbox-parts.d.ts +3 -2
  20. package/dist/checkbox.d.ts +3 -2
  21. package/dist/chip.d.ts +9 -7
  22. package/dist/collapsible-parts.d.ts +4 -3
  23. package/dist/collapsible.d.ts +4 -3
  24. package/dist/combobox-parts.d.ts +19 -63
  25. package/dist/combobox-parts.js +8 -2
  26. package/dist/combobox.d.ts +13 -76
  27. package/dist/command-palette-parts.d.ts +3 -3
  28. package/dist/command-palette-parts.js +1 -1
  29. package/dist/command-palette.d.ts +8 -54
  30. package/dist/composer.d.ts +5 -2
  31. package/dist/context-menu-parts.d.ts +8 -4
  32. package/dist/context-menu-parts.js +5 -1
  33. package/dist/context-menu.d.ts +8 -7
  34. package/dist/currency-input-parts.d.ts +4 -3
  35. package/dist/currency-input-parts.js +5 -2
  36. package/dist/data-table-parts.d.ts +18 -25
  37. package/dist/data-table-parts.js +1 -2
  38. package/dist/date-input-parts.d.ts +4 -3
  39. package/dist/date-input-parts.js +3 -2
  40. package/dist/date-picker-parts.d.ts +11 -10
  41. package/dist/date-picker-parts.js +6 -1
  42. package/dist/date-picker.d.ts +7 -21
  43. package/dist/date-range-picker-parts.d.ts +11 -10
  44. package/dist/date-range-picker-parts.js +6 -1
  45. package/dist/date-range-picker.d.ts +7 -21
  46. package/dist/description-list.d.ts +7 -3
  47. package/dist/dialog-parts.d.ts +8 -7
  48. package/dist/dialog.d.ts +10 -9
  49. package/dist/divider.d.ts +2 -1
  50. package/dist/drawer-parts.d.ts +9 -20
  51. package/dist/drawer.d.ts +10 -22
  52. package/dist/dropdown-menu-parts.d.ts +8 -4
  53. package/dist/dropdown-menu-parts.js +5 -1
  54. package/dist/dropdown-menu.d.ts +8 -7
  55. package/dist/empty-state.d.ts +11 -5
  56. package/dist/field-parts.d.ts +8 -7
  57. package/dist/field-parts.js +1 -1
  58. package/dist/file-dropzone-parts.d.ts +8 -7
  59. package/dist/file-dropzone.d.ts +4 -4
  60. package/dist/heading.d.ts +3 -3
  61. package/dist/hover-card-parts.d.ts +4 -4
  62. package/dist/hover-card.d.ts +3 -3
  63. package/dist/icon-button.d.ts +3 -2
  64. package/dist/icon.d.ts +3 -3
  65. package/dist/index.d.ts +2 -1
  66. package/dist/index.js +2 -1
  67. package/dist/input.d.ts +2 -1
  68. package/dist/lib/commit-on.d.ts +6 -5
  69. package/dist/lib/menu-parts.d.ts +9 -7
  70. package/dist/lib/modal-content.d.ts +5 -4
  71. package/dist/lib/modal-parts.d.ts +3 -2
  72. package/dist/lib/part.d.ts +3 -2
  73. package/dist/lib/picker.d.ts +18 -15
  74. package/dist/lib/picker.js +2 -1
  75. package/dist/link.d.ts +3 -3
  76. package/dist/list-row.d.ts +22 -0
  77. package/dist/list-row.js +14 -0
  78. package/dist/markdown.d.ts +2 -2
  79. package/dist/message.d.ts +9 -6
  80. package/dist/month-picker-parts.d.ts +2 -2
  81. package/dist/month-picker-parts.js +2 -2
  82. package/dist/month-stepper-parts.d.ts +7 -6
  83. package/dist/month-stepper-parts.js +3 -2
  84. package/dist/multiple-selector-parts.d.ts +23 -11
  85. package/dist/multiple-selector-parts.js +8 -3
  86. package/dist/multiple-selector.d.ts +11 -64
  87. package/dist/nav-bar.d.ts +5 -2
  88. package/dist/navigation-menu-parts.d.ts +8 -7
  89. package/dist/navigation-menu.d.ts +6 -6
  90. package/dist/otp-input-parts.d.ts +4 -3
  91. package/dist/otp-input.d.ts +4 -3
  92. package/dist/page-header.d.ts +7 -3
  93. package/dist/page.d.ts +7 -3
  94. package/dist/pagination.d.ts +12 -7
  95. package/dist/pill-select.d.ts +2 -1
  96. package/dist/popover-parts.d.ts +5 -5
  97. package/dist/popover.d.ts +4 -4
  98. package/dist/portal.d.ts +1 -1
  99. package/dist/progress-parts.d.ts +5 -4
  100. package/dist/progress-parts.js +1 -1
  101. package/dist/quantity-input-parts.d.ts +7 -6
  102. package/dist/quantity-input-parts.js +5 -2
  103. package/dist/radio-parts.d.ts +4 -3
  104. package/dist/radio.d.ts +2 -2
  105. package/dist/scroll-area-parts.d.ts +7 -6
  106. package/dist/scroll-area.d.ts +4 -4
  107. package/dist/select-parts.d.ts +10 -9
  108. package/dist/select.d.ts +6 -6
  109. package/dist/sheet-parts.d.ts +5 -5
  110. package/dist/sheet.d.ts +9 -7
  111. package/dist/sidebar.d.ts +19 -9
  112. package/dist/skeleton.d.ts +2 -1
  113. package/dist/slider-parts.d.ts +5 -4
  114. package/dist/slider.d.ts +5 -4
  115. package/dist/spinner.d.ts +2 -2
  116. package/dist/stack-parts.d.ts +8 -7
  117. package/dist/stack-parts.js +2 -1
  118. package/dist/stat.d.ts +9 -4
  119. package/dist/step-button.d.ts +4 -3
  120. package/dist/stepper-parts.d.ts +15 -10
  121. package/dist/stepper-parts.js +3 -2
  122. package/dist/stepper.d.ts +3 -3
  123. package/dist/styled.d.ts +5 -0
  124. package/dist/styled.js +0 -0
  125. package/dist/switch-parts.d.ts +3 -2
  126. package/dist/switch.d.ts +3 -2
  127. package/dist/table.d.ts +15 -7
  128. package/dist/tabs-parts.d.ts +5 -4
  129. package/dist/tabs.d.ts +5 -4
  130. package/dist/tag-input-parts.d.ts +18 -8
  131. package/dist/tag-input-parts.js +4 -2
  132. package/dist/text-morph.d.ts +3 -3
  133. package/dist/text-morph.js +1 -1
  134. package/dist/text-shimmer.d.ts +3 -3
  135. package/dist/text.d.ts +2 -1
  136. package/dist/textarea.d.ts +2 -1
  137. package/dist/time-range-parts.d.ts +6 -6
  138. package/dist/time-range-parts.js +3 -2
  139. package/dist/toast-parts.d.ts +7 -6
  140. package/dist/toggle-group-parts.d.ts +3 -2
  141. package/dist/toggle-group.d.ts +3 -2
  142. package/dist/tooltip-parts.d.ts +5 -5
  143. package/dist/tooltip.d.ts +3 -3
  144. package/dist/touch-target.d.ts +2 -2
  145. package/package.json +3 -3
@@ -1,4 +1,5 @@
1
- import { ComponentPropsWithRef, ElementType } from "react";
1
+ import { Styled } from "../styled.js";
2
+ import { ElementType } from "react";
2
3
  //#region src/lib/menu-parts.d.ts
3
4
  type MenuPrimitive = {
4
5
  Portal: ElementType;
@@ -7,15 +8,16 @@ type MenuPrimitive = {
7
8
  Label: ElementType;
8
9
  Separator: ElementType;
9
10
  };
11
+ type MenuParts<P extends MenuPrimitive> = {
12
+ Content: Styled<P["Content"]>;
13
+ Item: Styled<P["Item"]>;
14
+ Label: Styled<P["Label"]>;
15
+ Separator: Styled<P["Separator"]>;
16
+ };
10
17
  /**
11
18
  * Content, Item, Label and Separator for any Radix menu-like primitive
12
19
  * (dropdown menu, context menu, select). `slot` prefixes each `data-slot`.
13
20
  */
14
- declare const createMenuParts: <P extends MenuPrimitive>(primitive: P, slot: string) => {
15
- Content: (props: ComponentPropsWithRef<P['Content']>) => import("react").JSX.Element;
16
- Item: (props: ComponentPropsWithRef<P["Item"]>) => import("react").ReactNode;
17
- Label: (props: ComponentPropsWithRef<P["Label"]>) => import("react").ReactNode;
18
- Separator: (props: ComponentPropsWithRef<P["Separator"]>) => import("react").ReactNode;
19
- };
21
+ declare const createMenuParts: <P extends MenuPrimitive>(primitive: P, slot: string) => MenuParts<P>;
20
22
  //#endregion
21
23
  export { createMenuParts };
@@ -1,17 +1,18 @@
1
- import { ComponentPropsWithRef, ElementType, Ref } from "react";
1
+ import { ComponentPropsWithRef, ElementType, JSX, Ref } from "react";
2
2
  //#region src/lib/modal-content.d.ts
3
3
  type ModalPrimitive = {
4
4
  Portal: ElementType;
5
5
  Overlay: ElementType;
6
6
  Content: ElementType;
7
7
  };
8
- type ModalContentProps<P extends ModalPrimitive> = ComponentPropsWithRef<P['Content']> & {
8
+ type ModalContentProps<P extends ModalPrimitive> = ComponentPropsWithRef<P["Content"]> & {
9
9
  classNames?: {
10
10
  overlay?: string;
11
11
  };
12
12
  overlayRef?: Ref<HTMLDivElement>;
13
13
  };
14
+ type ModalContentPart<P extends ModalPrimitive> = (props: ModalContentProps<P>) => JSX.Element;
14
15
  /** Opens in a portal over an overlay. `slot` prefixes each `data-slot`, e.g. `dialog` gives `dialog` and `dialog-overlay`. */
15
- declare const createModalContent: <P extends ModalPrimitive>(primitive: P, slot: string) => ({ classNames, overlayRef, ...props }: ModalContentProps<P>) => import("react").JSX.Element;
16
+ declare const createModalContent: <P extends ModalPrimitive>(primitive: P, slot: string) => ModalContentPart<P>;
16
17
  //#endregion
17
- export { type ModalContentProps, createModalContent };
18
+ export { type ModalContentPart, type ModalContentProps, createModalContent };
@@ -1,6 +1,7 @@
1
+ import { Styled } from "../styled.js";
1
2
  //#region src/lib/modal-parts.d.ts
2
3
  /** Shared by Dialog, AlertDialog, Sheet and Drawer. */
3
- declare const Body: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
4
- declare const Actions: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
4
+ declare const Body: Styled<"div">;
5
+ declare const Actions: Styled<"div">;
5
6
  //#endregion
6
7
  export { Actions, Body };
@@ -1,6 +1,7 @@
1
- import { ComponentPropsWithRef, ElementType, ReactNode } from "react";
1
+ import { Styled } from "../styled.js";
2
+ import { ComponentPropsWithRef, ElementType } from "react";
2
3
  //#region src/lib/part.d.ts
3
4
  /** A part that tags its element with `data-slot` and applies default props. Props given by the caller win. */
4
- declare const part: <T extends ElementType>(element: T, slot: string, defaults?: Partial<ComponentPropsWithRef<T>>) => (props: ComponentPropsWithRef<T>) => ReactNode;
5
+ declare const part: <T extends ElementType>(element: T, slot: string, defaults?: Partial<ComponentPropsWithRef<T>>) => Styled<T>;
5
6
  //#endregion
6
7
  export { part };
@@ -1,4 +1,5 @@
1
- import { ComponentPropsWithRef, ReactNode } from "react";
1
+ import { Styled } from "../styled.js";
2
+ import { ComponentPropsWithRef, JSX, ReactNode } from "react";
2
3
  //#region src/lib/picker.d.ts
3
4
  type PickerState<V> = {
4
5
  value: V | null;
@@ -13,7 +14,7 @@ type PickerContextValue<V, M> = {
13
14
  actions: PickerActions<V>;
14
15
  meta: M;
15
16
  };
16
- type PickerProviderProps<V, M> = Omit<PickerContextValue<V, M>, 'meta'> & {
17
+ type PickerProviderProps<V, M> = Omit<PickerContextValue<V, M>, "meta"> & {
17
18
  meta?: M;
18
19
  children?: ReactNode;
19
20
  };
@@ -23,22 +24,24 @@ type PickerOptions<V> = {
23
24
  /** When the value counts as empty and `Value` shows its placeholder. */
24
25
  isEmpty?: (value: V | null) => boolean;
25
26
  };
26
- /**
27
- * The state, trigger and value shared by every picker that opens in a drawer
28
- * (combobox, date picker, date range picker). `slot` prefixes each `data-slot`.
29
- */
30
- declare const createPicker: <V, M extends object = object>(name: string, slot: string, { closeOnSelect, isEmpty }?: PickerOptions<V>) => {
31
- ContextProvider: ({ state, actions, meta, children }: PickerProviderProps<V, M>) => import("react").JSX.Element;
32
- Provider: ({ children, ...props }: PickerProviderProps<V, M>) => import("react").JSX.Element;
33
- Trigger: (props: ComponentPropsWithRef<'button'>) => import("react").JSX.Element;
34
- Value: ({ placeholder, children, ...props }: ComponentPropsWithRef<'span'> & {
35
- placeholder?: string;
36
- }) => import("react").JSX.Element;
37
- usePicker: any;
27
+ type PickerValueProps = ComponentPropsWithRef<"span"> & {
28
+ placeholder?: string;
29
+ };
30
+ type Picker<V, M extends object = object> = {
31
+ ContextProvider: (props: PickerProviderProps<V, M>) => JSX.Element;
32
+ Provider: (props: PickerProviderProps<V, M>) => JSX.Element;
33
+ Trigger: Styled<"button">;
34
+ Value: (props: PickerValueProps) => JSX.Element;
35
+ usePicker: () => PickerContextValue<V, M>;
38
36
  usePickerState: (value: V | null | undefined, defaultValue: V | null, onValueChange?: (value: V) => void) => {
39
37
  state: PickerState<V>;
40
38
  actions: PickerActions<V>;
41
39
  };
42
40
  };
41
+ /**
42
+ * The state, trigger and value shared by every picker that opens in a drawer
43
+ * (combobox, date picker, date range picker). `slot` prefixes each `data-slot`.
44
+ */
45
+ declare const createPicker: <V, M extends object = object>(name: string, slot: string, { closeOnSelect, isEmpty }?: PickerOptions<V>) => Picker<V, M>;
43
46
  //#endregion
44
- export { type PickerActions, type PickerContextValue, type PickerProviderProps, type PickerState, createPicker };
47
+ export { type Picker, type PickerActions, type PickerContextValue, type PickerProviderProps, type PickerState, type PickerValueProps, createPicker };
@@ -2,7 +2,8 @@ import { Button } from "../button.js";
2
2
  import { Root, Trigger } from "../drawer-parts.js";
3
3
  import { useState } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
- import { createRequiredContext, useControllableState } from "@journ/lift";
5
+ import { createRequiredContext } from "@journ/lift/required-context";
6
+ import { useControllableState } from "@journ/lift/use-controllable-state";
6
7
  //#region src/lib/picker.tsx
7
8
  /**
8
9
  * The state, trigger and value shared by every picker that opens in a drawer
package/dist/link.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- import { ComponentPropsWithRef } from "react";
1
+ import { ComponentPropsWithRef, JSX } from "react";
2
2
  //#region src/link.d.ts
3
- type LinkProps = ComponentPropsWithRef<'a'> & {
3
+ type LinkProps = ComponentPropsWithRef<"a"> & {
4
4
  asChild?: boolean;
5
5
  };
6
6
  /** Pass `asChild` to render your router's link component instead of a plain anchor. */
7
- declare const Link: ({ asChild, ...props }: LinkProps) => import("react").JSX.Element;
7
+ declare const Link: ({ asChild, ...props }: LinkProps) => JSX.Element;
8
8
  //#endregion
9
9
  export { Link, type LinkProps };
@@ -0,0 +1,22 @@
1
+ import { Styled } from "./styled.js";
2
+ //#region src/list-row.d.ts
3
+ declare const Root: Styled<"div">;
4
+ declare const Button: Styled<"button">;
5
+ declare const Link: Styled<"a">;
6
+ declare const Leading: Styled<"span">;
7
+ declare const Content: Styled<"span">;
8
+ declare const Title: Styled<"span">;
9
+ declare const Subtitle: Styled<"span">;
10
+ declare const Trailing: Styled<"span">;
11
+ declare const ListRow: {
12
+ Root: typeof Root;
13
+ Button: typeof Button;
14
+ Link: typeof Link;
15
+ Leading: typeof Leading;
16
+ Content: typeof Content;
17
+ Title: typeof Title;
18
+ Subtitle: typeof Subtitle;
19
+ Trailing: typeof Trailing;
20
+ };
21
+ //#endregion
22
+ export { ListRow };
@@ -0,0 +1,14 @@
1
+ import { part } from "./lib/part.js";
2
+ //#region src/list-row.tsx
3
+ const ListRow = {
4
+ Root: part("div", "list-row"),
5
+ Button: part("button", "list-row", { type: "button" }),
6
+ Link: part("a", "list-row"),
7
+ Leading: part("span", "list-row-leading"),
8
+ Content: part("span", "list-row-content"),
9
+ Title: part("span", "list-row-title"),
10
+ Subtitle: part("span", "list-row-subtitle"),
11
+ Trailing: part("span", "list-row-trailing")
12
+ };
13
+ //#endregion
14
+ export { ListRow };
@@ -1,10 +1,10 @@
1
- import { ComponentProps } from "react";
1
+ import { ComponentProps, JSX } from "react";
2
2
  import ReactMarkdown, { Components as MarkdownComponents } from "react-markdown";
3
3
  //#region src/markdown.d.ts
4
4
  type MarkdownProps = ComponentProps<typeof ReactMarkdown> & {
5
5
  /** Applied to the wrapper. */
6
6
  className?: string;
7
7
  };
8
- declare const Markdown: ({ className, ...props }: MarkdownProps) => import("react").JSX.Element;
8
+ declare const Markdown: ({ className, ...props }: MarkdownProps) => JSX.Element;
9
9
  //#endregion
10
10
  export { Markdown, type MarkdownComponents, type MarkdownProps };
package/dist/message.d.ts CHANGED
@@ -1,13 +1,16 @@
1
- import { ComponentPropsWithRef } from "react";
1
+ import { Styled } from "./styled.js";
2
+ import { ComponentPropsWithRef, JSX } from "react";
2
3
  //#region src/message.d.ts
3
- type RootProps = ComponentPropsWithRef<'div'> & {
4
- from?: 'agent' | 'user';
4
+ type RootProps = ComponentPropsWithRef<"div"> & {
5
+ from?: "agent" | "user";
5
6
  };
6
- declare const Root: ({ from, ...props }: RootProps) => import("react").JSX.Element;
7
+ declare const Root: ({ from, ...props }: RootProps) => JSX.Element;
8
+ declare const Bubble: Styled<"div">;
9
+ declare const Highlight: Styled<"span">;
7
10
  declare const Message: {
8
11
  Root: typeof Root;
9
- Bubble: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
10
- Highlight: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>) => import("react").ReactNode;
12
+ Bubble: typeof Bubble;
13
+ Highlight: typeof Highlight;
11
14
  };
12
15
  //#endregion
13
16
  export { Message, type RootProps as MessageProps };
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { JSX, ReactNode } from "react";
2
2
  //#region src/month-picker-parts.d.ts
3
3
  type RootProps = {
4
4
  /** Any day in the selected month. Reported back as the first of the month. */
@@ -14,6 +14,6 @@ type RootProps = {
14
14
  * A calendar that stops at months: it reuses the Calendar parts (Frame, Header,
15
15
  * Heading, Previous, Next, Months, Years) and never shows days.
16
16
  */
17
- declare const Root: ({ value, defaultValue, onValueChange, defaultMonth, locale, children }: RootProps) => import("react").JSX.Element;
17
+ declare const Root: ({ value, defaultValue, onValueChange, defaultMonth, locale, children }: RootProps) => JSX.Element;
18
18
  //#endregion
19
19
  export { Root, type RootProps };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Provider, useCalendarNavigation } from "./calendar-parts.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
- import { useControllableState } from "@journ/lift";
5
- import { startOfMonth } from "@journ/fitter-happier";
4
+ import { startOfMonth } from "@journ/fitter-happier/month";
5
+ import { useControllableState } from "@journ/lift/use-controllable-state";
6
6
  //#region src/month-picker-parts.tsx
7
7
  /**
8
8
  * A calendar that stops at months: it reuses the Calendar parts (Frame, Header,
@@ -1,16 +1,17 @@
1
+ import { Styled } from "./styled.js";
1
2
  import { IconButtonProps } from "./icon-button.js";
2
- import { ComponentPropsWithRef } from "react";
3
+ import { ComponentPropsWithRef, JSX } from "react";
3
4
  //#region src/month-stepper-parts.d.ts
4
- type RootProps = Omit<ComponentPropsWithRef<'div'>, 'defaultValue'> & {
5
+ type RootProps = Omit<ComponentPropsWithRef<"div">, "defaultValue"> & {
5
6
  value?: Date;
6
7
  defaultValue?: Date;
7
8
  onValueChange?: (month: Date) => void;
8
9
  locale?: string;
9
10
  };
10
11
  /** Always reports the first day of the month. */
11
- declare const Root: ({ value, defaultValue, onValueChange, locale, ...props }: RootProps) => import("react").JSX.Element;
12
- declare const Previous: (props: IconButtonProps) => import("react").JSX.Element;
13
- declare const Next: (props: IconButtonProps) => import("react").JSX.Element;
14
- declare const Label: (props: ComponentPropsWithRef<'span'>) => import("react").JSX.Element;
12
+ declare const Root: ({ value, defaultValue, onValueChange, locale, ...props }: RootProps) => JSX.Element;
13
+ declare const Previous: (props: IconButtonProps) => JSX.Element;
14
+ declare const Next: (props: IconButtonProps) => JSX.Element;
15
+ declare const Label: Styled<"span">;
15
16
  //#endregion
16
17
  export { Label, Next, Previous, Root, type RootProps };
@@ -1,8 +1,9 @@
1
1
  "use client";
2
2
  import { StepButton } from "./step-button.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
- import { createRequiredContext, useControllableState } from "@journ/lift";
5
- import { addMonths, formatMonthYear, startOfMonth } from "@journ/fitter-happier";
4
+ import { addMonths, formatMonthYear, startOfMonth } from "@journ/fitter-happier/month";
5
+ import { createRequiredContext } from "@journ/lift/required-context";
6
+ import { useControllableState } from "@journ/lift/use-controllable-state";
6
7
  //#region src/month-stepper-parts.tsx
7
8
  const [MonthStepperContext, useMonthStepper] = createRequiredContext("MonthStepper.Root");
8
9
  /** Always reports the first day of the month. */
@@ -1,10 +1,22 @@
1
+ import { Styled } from "./styled.js";
2
+ import { Picker } from "./lib/picker.js";
1
3
  import { Empty, Frame, Group, Input as Input$1, ItemIndicator, List, Option } from "./combobox-parts.js";
2
- import { ComponentPropsWithRef, ElementType, ReactNode } from "react";
4
+ import { ComponentPropsWithRef, ElementType, JSX, ReactNode } from "react";
3
5
  //#region src/multiple-selector-parts.d.ts
4
- declare const Trigger: (props: ComponentPropsWithRef<'button'>) => import("react").JSX.Element, PickerValue: ({ placeholder, children, ...props }: import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
5
- placeholder?: string;
6
- }) => import("react").JSX.Element;
7
- declare const useMultipleSelector: any;
6
+ declare const Trigger: Picker<string[]>["Trigger"];
7
+ declare const PickerValue: Picker<string[]>["Value"];
8
+ type SelectionContextValue = {
9
+ selected: string[];
10
+ fixed: string[];
11
+ /** True once `max` values are chosen: nothing more can be added. */
12
+ full: boolean;
13
+ search: string;
14
+ setSearch: (search: string) => void;
15
+ toggle: (value: string) => void;
16
+ remove: (value: string) => void;
17
+ create: (text: string) => void;
18
+ };
19
+ declare const useMultipleSelector: () => SelectionContextValue;
8
20
  type RootProps = {
9
21
  value?: string[];
10
22
  defaultValue?: string[];
@@ -19,9 +31,9 @@ type RootProps = {
19
31
  * A combobox that keeps its drawer open and collects values. A value is also its
20
32
  * label. Build the list from Combobox's parts, plus `Create` to allow new values.
21
33
  */
22
- declare const Root: ({ value, defaultValue, onValueChange, fixed, max, children }: RootProps) => import("react").JSX.Element;
34
+ declare const Root: ({ value, defaultValue, onValueChange, fixed, max, children }: RootProps) => JSX.Element;
23
35
  /** The count of chosen values, or `children` when given. */
24
- declare const Value: ({ placeholder, children, ...props }: ComponentPropsWithRef<typeof PickerValue>) => import("react").JSX.Element;
36
+ declare const Value: Styled<typeof PickerValue>;
25
37
  type TagsProps = {
26
38
  /** The chip rendered per value. It receives `removeLabel`, `onRemove` and the value as children. */
27
39
  components?: {
@@ -29,11 +41,11 @@ type TagsProps = {
29
41
  };
30
42
  };
31
43
  /** One chip per chosen value, with a remove button unless the value is fixed. */
32
- declare const Tags: ({ components }: TagsProps) => any;
33
- declare const Input: (props: ComponentPropsWithRef<typeof Input$1>) => import("react").JSX.Element;
44
+ declare const Tags: ({ components }: TagsProps) => ReactNode;
45
+ declare const Input: Styled<typeof Input$1>;
34
46
  /** Toggles its value. Fixed values are locked, and unchosen values lock once `max` is reached. */
35
- declare const Item: ({ value, disabled, ...props }: Omit<ComponentPropsWithRef<typeof Option>, 'checked' | 'onPick'>) => import("react").JSX.Element;
47
+ declare const Item: ({ value, disabled, ...props }: Omit<ComponentPropsWithRef<typeof Option>, "checked" | "onPick">) => JSX.Element;
36
48
  /** Offers the typed text as a new value. Hidden when empty, already chosen, or the selection is full. */
37
- declare const Create: ({ children, ...props }: Omit<ComponentPropsWithRef<typeof Option>, 'value' | 'checked' | 'onPick'>) => import("react").JSX.Element | null;
49
+ declare const Create: ({ children, ...props }: Omit<ComponentPropsWithRef<typeof Option>, "value" | "checked" | "onPick">) => ReactNode;
38
50
  //#endregion
39
51
  export { Create, Empty, Frame, Group, Input, Item, ItemIndicator, List, Root, type RootProps, Tags, Trigger, Value, useMultipleSelector };
@@ -4,13 +4,18 @@ import { createPicker } from "./lib/picker.js";
4
4
  import { Empty, Frame, Group, Input as Input$1, ItemIndicator, List, Option } from "./combobox-parts.js";
5
5
  import { useState } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
- import { createRequiredContext } from "@journ/lift";
7
+ import { createRequiredContext } from "@journ/lift/required-context";
8
8
  //#region src/multiple-selector-parts.tsx
9
- const { Provider, Trigger, Value: PickerValue, usePickerState } = createPicker("MultipleSelector", "multiple-selector", {
9
+ const picker = createPicker("MultipleSelector", "multiple-selector", {
10
10
  closeOnSelect: false,
11
11
  isEmpty: (value) => !value || value.length === 0
12
12
  });
13
- const [SelectionContext, useMultipleSelector] = createRequiredContext("MultipleSelector.Root");
13
+ const Provider = picker.Provider;
14
+ const Trigger = picker.Trigger;
15
+ const PickerValue = picker.Value;
16
+ const usePickerState = picker.usePickerState;
17
+ const [SelectionContext, useMultipleSelectorContext] = createRequiredContext("MultipleSelector.Root");
18
+ const useMultipleSelector = useMultipleSelectorContext;
14
19
  const none = [];
15
20
  /**
16
21
  * A combobox that keeps its drawer open and collects values. A value is also its
@@ -1,73 +1,20 @@
1
- import { ModalContentProps } from "./lib/modal-content.js";
2
- import { ItemIndicator } from "./combobox-parts.js";
3
- import { Create, Input, Item, Root, RootProps, Tags, Value, useMultipleSelector } from "./multiple-selector-parts.js";
1
+ import { Empty, Frame, Group, ItemIndicator, List } from "./combobox-parts.js";
2
+ import { Content, Description, Title } from "./drawer-parts.js";
3
+ import { Create, Input, Item, Root, RootProps, Tags, Trigger, Value, useMultipleSelector } from "./multiple-selector-parts.js";
4
4
  //#region src/multiple-selector.d.ts
5
5
  declare const MultipleSelector: {
6
6
  Root: typeof Root;
7
- Trigger: (props: import("react").ComponentPropsWithRef<'button'>) => import("react").JSX.Element;
7
+ Trigger: typeof Trigger;
8
8
  Value: typeof Value;
9
9
  Tags: typeof Tags;
10
- Content: ({ classNames, overlayRef, ...props }: ModalContentProps<{
11
- Root: typeof import("vaul").Root;
12
- NestedRoot: typeof import("vaul").NestedRoot;
13
- Content: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
14
- Overlay: React.ForwardRefExoticComponent<Omit<import("@radix-ui/react-dialog").DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
15
- Trigger: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
16
- Portal: typeof import("vaul").Portal;
17
- Handle: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
18
- preventCycle?: boolean | undefined;
19
- } & React.RefAttributes<HTMLDivElement>>;
20
- Close: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
21
- Title: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogTitleProps & React.RefAttributes<HTMLHeadingElement>>;
22
- Description: React.ForwardRefExoticComponent<import("@radix-ui/react-dialog").DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
23
- }>) => import("react").JSX.Element;
24
- Title: (props: import("@radix-ui/react-dialog").DialogTitleProps & import("react").RefAttributes<HTMLHeadingElement>) => import("react").ReactNode;
25
- Description: (props: import("@radix-ui/react-dialog").DialogDescriptionProps & import("react").RefAttributes<HTMLParagraphElement>) => import("react").ReactNode;
26
- Frame: (props: {
27
- children?: React.ReactNode;
28
- } & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
29
- ref?: React.Ref<HTMLDivElement>;
30
- } & {
31
- asChild?: boolean;
32
- }, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
33
- label?: string;
34
- shouldFilter?: boolean;
35
- filter?: (value: string, search: string, keywords?: string[]) => number;
36
- defaultValue?: string;
37
- value?: string;
38
- onValueChange?: (value: string) => void;
39
- loop?: boolean;
40
- disablePointerSelection?: boolean;
41
- vimBindings?: boolean;
42
- } & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
10
+ Content: typeof Content;
11
+ Title: typeof Title;
12
+ Description: typeof Description;
13
+ Frame: typeof Frame;
43
14
  Input: typeof Input;
44
- List: (props: {
45
- children?: React.ReactNode;
46
- } & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
47
- ref?: React.Ref<HTMLDivElement>;
48
- } & {
49
- asChild?: boolean;
50
- }, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
51
- label?: string;
52
- } & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
53
- Empty: (props: {
54
- children?: React.ReactNode;
55
- } & Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
56
- ref?: React.Ref<HTMLDivElement>;
57
- } & {
58
- asChild?: boolean;
59
- }, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
60
- Group: (props: {
61
- children?: React.ReactNode;
62
- } & Omit<Pick<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
63
- ref?: React.Ref<HTMLDivElement>;
64
- } & {
65
- asChild?: boolean;
66
- }, "asChild" | "key" | keyof import("react").HTMLAttributes<HTMLDivElement>>, "heading" | "value"> & {
67
- heading?: React.ReactNode;
68
- value?: string;
69
- forceMount?: boolean;
70
- } & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
15
+ List: typeof List;
16
+ Empty: typeof Empty;
17
+ Group: typeof Group;
71
18
  Item: typeof Item;
72
19
  ItemIndicator: typeof ItemIndicator;
73
20
  Create: typeof Create;
package/dist/nav-bar.d.ts CHANGED
@@ -1,7 +1,10 @@
1
+ import { Styled } from "./styled.js";
1
2
  //#region src/nav-bar.d.ts
3
+ declare const Root: Styled<"nav">;
4
+ declare const Item: Styled<"a">;
2
5
  declare const NavBar: {
3
- Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
4
- Item: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
6
+ Root: typeof Root;
7
+ Item: typeof Item;
5
8
  };
6
9
  //#endregion
7
10
  export { NavBar };
@@ -1,4 +1,5 @@
1
- import { ComponentPropsWithRef } from "react";
1
+ import { Styled } from "./styled.js";
2
+ import { ComponentPropsWithRef, JSX } from "react";
2
3
  import * as RadixNav from "@radix-ui/react-navigation-menu";
3
4
  //#region src/navigation-menu-parts.d.ts
4
5
  type RootProps = ComponentPropsWithRef<typeof RadixNav.Root> & {
@@ -8,11 +9,11 @@ type RootProps = ComponentPropsWithRef<typeof RadixNav.Root> & {
8
9
  };
9
10
  };
10
11
  /** Includes the viewport, the panel that Content opens into. */
11
- declare const Root: ({ classNames, children, ...props }: RootProps) => import("react").JSX.Element;
12
- declare const List: (props: RadixNav.NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>) => import("react").ReactNode;
13
- declare const Item: import("react").ForwardRefExoticComponent<RadixNav.NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
14
- declare const Trigger: (props: RadixNav.NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactNode;
15
- declare const Content: (props: RadixNav.NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
16
- declare const Link: (props: RadixNav.NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>) => import("react").ReactNode;
12
+ declare const Root: ({ classNames, children, ...props }: RootProps) => JSX.Element;
13
+ declare const List: Styled<typeof RadixNav.List>;
14
+ declare const Item: typeof RadixNav.Item;
15
+ declare const Trigger: Styled<typeof RadixNav.Trigger>;
16
+ declare const Content: Styled<typeof RadixNav.Content>;
17
+ declare const Link: Styled<typeof RadixNav.Link>;
17
18
  //#endregion
18
19
  export { Content, Item, Link, List, Root, Trigger };
@@ -1,12 +1,12 @@
1
- import { Root } from "./navigation-menu-parts.js";
1
+ import { Content, Item, Link, List, Root, Trigger } from "./navigation-menu-parts.js";
2
2
  //#region src/navigation-menu.d.ts
3
3
  declare const NavigationMenu: {
4
4
  Root: typeof Root;
5
- List: (props: import("@radix-ui/react-navigation-menu").NavigationMenuListProps & import("react").RefAttributes<HTMLUListElement>) => import("react").ReactNode;
6
- Item: import("react").ForwardRefExoticComponent<import("@radix-ui/react-navigation-menu").NavigationMenuItemProps & import("react").RefAttributes<HTMLLIElement>>;
7
- Trigger: (props: import("@radix-ui/react-navigation-menu").NavigationMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>) => import("react").ReactNode;
8
- Content: (props: import("@radix-ui/react-navigation-menu").NavigationMenuContentProps & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
9
- Link: (props: import("@radix-ui/react-navigation-menu").NavigationMenuLinkProps & import("react").RefAttributes<HTMLAnchorElement>) => import("react").ReactNode;
5
+ List: typeof List;
6
+ Item: typeof Item;
7
+ Trigger: typeof Trigger;
8
+ Content: typeof Content;
9
+ Link: typeof Link;
10
10
  };
11
11
  //#endregion
12
12
  export { NavigationMenu };
@@ -1,9 +1,10 @@
1
+ import { Styled } from "./styled.js";
1
2
  import * as RadixOtp from "@radix-ui/react-one-time-password-field";
2
3
  //#region src/otp-input-parts.d.ts
3
- declare const Root: (props: Omit<RadixOtp.OneTimePasswordFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
4
+ declare const Root: Styled<typeof RadixOtp.Root>;
4
5
  /** One box per character. Render as many as the code is long. */
5
- declare const Slot: (props: Omit<RadixOtp.OneTimePasswordFieldInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
6
+ declare const Slot: Styled<typeof RadixOtp.Input>;
6
7
  /** Submits the whole code with a surrounding form. Render it once, after the slots. */
7
- declare const Hidden: import("react").ForwardRefExoticComponent<Omit<RadixOtp.OneTimePasswordFieldHiddenInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
8
+ declare const Hidden: typeof RadixOtp.HiddenInput;
8
9
  //#endregion
9
10
  export { Hidden, Root, Slot };
@@ -1,8 +1,9 @@
1
+ import { Hidden, Root, Slot } from "./otp-input-parts.js";
1
2
  //#region src/otp-input.d.ts
2
3
  declare const OtpInput: {
3
- Root: (props: Omit<import("@radix-ui/react-one-time-password-field").OneTimePasswordFieldProps, "ref"> & import("react").RefAttributes<HTMLDivElement>) => import("react").ReactNode;
4
- Slot: (props: Omit<import("@radix-ui/react-one-time-password-field").OneTimePasswordFieldInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>) => import("react").ReactNode;
5
- Hidden: import("react").ForwardRefExoticComponent<Omit<import("@radix-ui/react-one-time-password-field").OneTimePasswordFieldHiddenInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
4
+ Root: typeof Root;
5
+ Slot: typeof Slot;
6
+ Hidden: typeof Hidden;
6
7
  };
7
8
  //#endregion
8
9
  export { OtpInput };
@@ -1,8 +1,12 @@
1
+ import { Styled } from "./styled.js";
1
2
  //#region src/page-header.d.ts
3
+ declare const Root: Styled<"header">;
4
+ declare const Title: Styled<"h1">;
5
+ declare const Actions: Styled<"div">;
2
6
  declare const PageHeader: {
3
- Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
4
- Title: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>) => import("react").ReactNode;
5
- Actions: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
7
+ Root: typeof Root;
8
+ Title: typeof Title;
9
+ Actions: typeof Actions;
6
10
  };
7
11
  //#endregion
8
12
  export { PageHeader };
package/dist/page.d.ts CHANGED
@@ -1,8 +1,12 @@
1
+ import { Styled } from "./styled.js";
1
2
  //#region src/page.d.ts
3
+ declare const Root: Styled<"div">;
4
+ declare const Content: Styled<"main">;
5
+ declare const Footer: Styled<"div">;
2
6
  declare const Page: {
3
- Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
4
- Content: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
5
- Footer: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
7
+ Root: typeof Root;
8
+ Content: typeof Content;
9
+ Footer: typeof Footer;
6
10
  };
7
11
  //#endregion
8
12
  export { Page };
@@ -1,13 +1,18 @@
1
- import { ComponentPropsWithRef } from "react";
1
+ import { Styled } from "./styled.js";
2
2
  //#region src/pagination.d.ts
3
- declare const Gap: (props: ComponentPropsWithRef<'span'>) => import("react").JSX.Element;
3
+ declare const Root: Styled<"nav">;
4
+ declare const List: Styled<"div">;
5
+ declare const Previous: Styled<"a">;
6
+ declare const Next: Styled<"a">;
7
+ declare const Page: Styled<"a">;
8
+ declare const Gap: Styled<"span">;
4
9
  declare const Pagination: {
5
- Root: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>) => import("react").ReactNode;
6
- Previous: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
7
- List: (props: import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>) => import("react").ReactNode;
8
- Page: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
10
+ Root: typeof Root;
11
+ Previous: typeof Previous;
12
+ List: typeof List;
13
+ Page: typeof Page;
9
14
  Gap: typeof Gap;
10
- Next: (props: import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>) => import("react").ReactNode;
15
+ Next: typeof Next;
11
16
  };
12
17
  //#endregion
13
18
  export { Pagination };