@ostack.tech/ui 0.16.4 → 1.0.0-rc.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.
- package/dist/chunks/{en-DT1KWQei.js → en-DGLb7rrz.js} +3 -1
- package/dist/chunks/en-DGLb7rrz.js.map +1 -0
- package/dist/locales/en-GB.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/fr-FR.js +2 -0
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js +2 -0
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +32 -9
- package/dist/ostack-ui.js +7632 -7150
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +1 -1
- package/scss/_utils.scss +1 -0
- package/scss/components/Actions/_Actions-variables.scss +5 -0
- package/scss/components/Actions/_Actions.scss +19 -0
- package/scss/components/ButtonGroup/_ButtonGroup.scss +2 -2
- package/scss/components/Root/_Root.scss +3 -3
- package/scss/components/Toast/_Toast.scss +1 -1
- package/scss/index.scss +1 -0
- package/scss/scss/placeholders/menu/_menu.scss +22 -4
- package/types/components/Actions/Action.d.ts +38 -0
- package/types/components/Actions/ActionGroup.d.ts +36 -0
- package/types/components/Actions/ActionMenu.d.ts +48 -0
- package/types/components/Actions/ActionMenuCheckboxItem.d.ts +5 -0
- package/types/components/Actions/ActionMenuRadioGroup.d.ts +5 -0
- package/types/components/Actions/ActionMenuRadioItem.d.ts +5 -0
- package/types/components/Actions/ActionSplit.d.ts +28 -0
- package/types/components/Actions/Actions.d.ts +87 -0
- package/types/components/Actions/ActionsContext.d.ts +13 -0
- package/types/components/Actions/ActionsSecondary.d.ts +6 -0
- package/types/components/Actions/index.d.ts +10 -0
- package/types/components/Actions/useActionsLayouts.d.ts +9 -0
- package/types/components/AlertDialog/AlertDialogContent.d.ts +3 -3
- package/types/components/Button/Button.d.ts +1 -1
- package/types/components/ButtonGroup/ButtonGroup.d.ts +4 -2
- package/types/components/Collapsible/Collapsible.d.ts +1 -1
- package/types/components/CommandMenu/CommandMenu.d.ts +2 -2
- package/types/components/CommandMenu/CommandMenuDialog.d.ts +1 -1
- package/types/components/DataTable/DataTableSelectionTrigger.d.ts +19 -4
- package/types/components/MenuList/MenuList.d.ts +1 -1
- package/types/components/MenuList/MenuListItem.d.ts +2 -2
- package/types/components/Printer/PrinterContentContext.d.ts +1 -1
- package/types/components/Tag/Tag.d.ts +2 -2
- package/types/index.d.ts +1 -0
- package/types/providers/LocalizationProvider/LocalizationObject.d.ts +3 -0
- package/types/utils/breakpoints.d.ts +6 -0
- package/types/utils/useResponsiveValues.d.ts +14 -1
- package/types/utils/useSafeLayoutEffect.d.ts +2 -2
- package/dist/chunks/en-DT1KWQei.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Locale as DayPickerLocale } from "@daypicker/react";
|
|
2
|
+
import type { ActionSplitProps, ActionsSecondaryProps } from "../../components/Actions";
|
|
2
3
|
import type { CalendarProps } from "../../components/Calendar";
|
|
3
4
|
import type { CloseButtonProps } from "../../components/CloseButton";
|
|
4
5
|
import type { CollapsibleTriggerChildlessProps } from "../../components/Collapsible";
|
|
@@ -26,6 +27,8 @@ import type { ConfirmDialogOptions } from "../AlertDialogProvider";
|
|
|
26
27
|
export interface LocalizationObject {
|
|
27
28
|
languageTag: string;
|
|
28
29
|
dayPickerLocale: DayPickerLocale;
|
|
30
|
+
ActionSplit: Pick<ActionSplitProps, "splitLabel">;
|
|
31
|
+
ActionsSecondary: Pick<ActionsSecondaryProps, "label">;
|
|
29
32
|
AlertDialog: Pick<ConfirmDialogOptions, "okText">;
|
|
30
33
|
Calendar: Pick<CalendarProps, "monthSelectLabel" | "yearSelectLabel" | "previousMonthLabel" | "nextMonthLabel">;
|
|
31
34
|
CloseButton: Pick<CloseButtonProps, "label">;
|
|
@@ -30,3 +30,9 @@ export declare function useMediaBreakpointUp(breakpoint: Breakpoint, options?: U
|
|
|
30
30
|
* breakpoint.
|
|
31
31
|
*/
|
|
32
32
|
export declare function useMediaBreakpointDown(breakpoint: Breakpoint, options?: UseMediaQueryOptions): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Hook that returns the currently active media breakpoint.
|
|
35
|
+
*
|
|
36
|
+
* @returns Currently active breakpoint.
|
|
37
|
+
*/
|
|
38
|
+
export declare function useCurrentMediaBreakpoint(options?: UseMediaQueryOptions): Breakpoint;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Breakpoint } from "./breakpoints.ts";
|
|
2
2
|
import { type UseCssVarsOptions } from "./useCssVars.ts";
|
|
3
3
|
/** Value allowing for different values depending on the current breakpoint. */
|
|
4
4
|
export type Responsive<T = unknown> = T | Partial<Record<Breakpoint, T>>;
|
|
@@ -29,3 +29,16 @@ export interface UseResponsiveValuesResult {
|
|
|
29
29
|
}
|
|
30
30
|
/** Hook providing access to responsive value utilities. */
|
|
31
31
|
export declare function useResponsiveValues(options?: UseResponsiveValuesOptions): UseResponsiveValuesResult;
|
|
32
|
+
/**
|
|
33
|
+
* Resolves a `Responsive<T>` value to the specific value matching the current
|
|
34
|
+
* breakpoint.
|
|
35
|
+
*
|
|
36
|
+
* @param value Responsive value.
|
|
37
|
+
* @param defaultValue Fallback value if no matching breakpoint is found or if
|
|
38
|
+
* `value` is `undefined`.
|
|
39
|
+
* @returns The resolved value for the current breakpoint, or `defaultValue`.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useCurrentResponsiveValue<T = unknown>(value: Responsive<T> | undefined): T | undefined;
|
|
42
|
+
export declare function useCurrentResponsiveValue<T = unknown>(value: Responsive<T> | undefined, defaultValue: T): T;
|
|
43
|
+
/** Whether the provided value is (probably) a responsive value object. */
|
|
44
|
+
export declare function isResponsiveValueObject<T = unknown>(value: Responsive<T>): value is Partial<Record<Breakpoint, T>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useEffect } from "react";
|
|
2
2
|
/** `useLayoutEffect` hook which runs `useEffect` on the server. */
|
|
3
|
-
export declare const useSafeLayoutEffect: typeof
|
|
3
|
+
export declare const useSafeLayoutEffect: typeof useEffect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"en-DT1KWQei.js","names":[],"sources":["../../src/locales/en.tsx"],"sourcesContent":["import type { LocalizationObject } from \"../providers/LocalizationProvider\";\nimport { IS_APPLE } from \"../utils/platformUtils.ts\";\n\n/** `en` locale (partial). */\nexport const en: Omit<LocalizationObject, \"languageTag\" | \"dayPickerLocale\"> = {\n AlertDialog: {\n okText: \"OK\",\n },\n Calendar: {\n monthSelectLabel: \"Month\",\n yearSelectLabel: \"Year\",\n previousMonthLabel: \"Previous month\",\n nextMonthLabel: \"Next month\",\n },\n CloseButton: {\n label: \"Close\",\n },\n CollapsibleTrigger: {\n expandLabel: \"Show\",\n collapseLabel: \"Hide\",\n },\n CommandMenu: {\n searchPlaceholder: \"Search…\",\n listLabel: \"Suggestions\",\n loadingLabel: \"Loading…\",\n emptyMessage: \"No results found.\",\n },\n CommandMenuDialog: {\n title: \"Command palette\",\n description: \"Search for a command…\",\n },\n ConfirmDialog: {\n cancelText: \"Cancel\",\n },\n ControlCode: {\n visuallyHiddenPrefix: \"Field\",\n },\n DataTable: {\n selectAllRowsLabel: \"Select all\",\n selectRowLabel: \"Select\",\n },\n DataTableContent: {\n emptyMessage: \"Nothing to show.\",\n },\n DataTableFilter: {\n \"aria-label\": \"Search table\",\n placeholder: \"Search…\",\n },\n DataTablePagination: {\n \"aria-label\": \"Table pagination\",\n rowsRangeSelectLabel: (total) => `Visible rows out of ${total}`,\n rowsRange: (range, total) => (\n <>\n Rows {range} of {total}\n </>\n ),\n previousPageButtonLabel: \"Previous page\",\n nextPageButtonLabel: \"Next page\",\n },\n DataTableRowsPerPage: {\n label: \"Rows per page:\",\n },\n DateInput: {\n selectedDateDescription: (date) => `Selected date, ${date}`,\n calendarButtonLabel: \"Open calendar\",\n },\n DateRangeInput: {\n startInputLabel: \"Start date\",\n endInputLabel: \"End date\",\n selectedDateRangeDescription: ({ start, end }) =>\n `Selected date range, ${start || \"missing start date\"} to ${\n end || \"missing end date\"\n }`,\n },\n ErrorBoundary: {\n fallbackMessage: (\n <>\n Something went wrong.\n <br />\n Press the button on the right to try again. If the problem persists,\n please try again later.\n </>\n ),\n resetButtonLabel: \"Retry\",\n },\n Feedback: {\n visuallyHiddenPrefix: (type) =>\n type === \"error\" ? \"Error,\" : type === \"warning\" ? \"Warning,\" : null,\n },\n FeedbackPopover: {\n label: \"Show feedback\",\n },\n FieldGroupHeader: {\n visuallyHiddenCodePrefix: \"Section\",\n },\n Form: {\n submitErrorMessage:\n \"An error occurred during submission. Please try again later.\",\n nativeErrorMessages: {\n valueMissing: \"Required.\",\n badInput: \"Unrecognized format.\",\n typeMismatch: (el) => {\n const type = (el as HTMLInputElement).type;\n return type === \"email\" ? \"Invalid email.\" : \"Invalid URL.\";\n },\n patternMismatch: \"Invalid format.\",\n tooShort: (el) => {\n const minLength = (el as HTMLInputElement).minLength;\n return `Requires at least ${minLength} ${\n minLength === 1 ? \"character\" : \"characters\"\n }.`;\n },\n tooLong: (el) => {\n const maxLength = (el as HTMLInputElement).maxLength;\n return `Limited to at most ${maxLength} ${\n maxLength === 1 ? \"character\" : \"characters\"\n }.`;\n },\n rangeUnderflow: (el) => {\n const min = (el as HTMLInputElement).min;\n return `Below minimum of ${min}.`;\n },\n rangeOverflow: (el) => {\n const max = (el as HTMLInputElement).max;\n return `Above maximum of ${max}.`;\n },\n stepMismatch: \"Invalid value increment.\",\n },\n },\n Input: {\n loadingDescription: \"Loading…\",\n clearButtonLabel: \"Clear\",\n },\n Keybinds: {\n keybindsSeparatorLabel: \"or\",\n keyPressesSeparatorLabel: \"then\",\n keyLabels: {\n Meta: IS_APPLE ? undefined : \"Windows Key\",\n },\n },\n Label: {\n helperButtonLabel: \"Show help\",\n },\n NumericInput: {\n decimalSeparator: \".\",\n groupingStyle: \"thousand\",\n groupSeparator: \",\",\n },\n RadioGroup: {\n clearDescription: \"Press Backspace or Delete to clear.\",\n },\n Select: {\n placeholder: \"Select…\",\n clearDescription: \"Press Backspace or Delete to clear.\",\n searchLabel: \"Search options\",\n optionsLabel: \"Options\",\n valueTagCloseButtonLabel: \"Remove\",\n },\n Step: {\n stepNumberLabel: (number) => `Step ${number}`,\n completedLabel: \"Completed\",\n },\n StepperFinishTrigger: {\n label: \"Finish\",\n },\n StepperNextTrigger: {\n label: \"Next\",\n },\n StepperPreviousTrigger: {\n label: \"Back\",\n },\n TableColumn: {\n helperButtonLabel: \"Show help\",\n },\n TableHead: {\n sortByColumnDescription: (sortDirection) =>\n sortDirection === null\n ? \"Clear sort\"\n : `Sort ${sortDirection === \"asc\" ? \"ascending\" : \"descending\"}`,\n },\n TabList: {\n scrollLeftButtonLabel: \"Scroll left\",\n scrollRightButtonLabel: \"Scroll right\",\n },\n ToastProvider: {\n label: \"Notification\",\n },\n ToastViewport: {\n label: \"Notifications ({hotkey})\",\n },\n};\n"],"mappings":";;;;AAIA,IAAa,KAAkE;CAC7E,aAAa,EACX,QAAQ,KACV;CACA,UAAU;EACR,kBAAkB;EAClB,iBAAiB;EACjB,oBAAoB;EACpB,gBAAgB;CAClB;CACA,aAAa,EACX,OAAO,QACT;CACA,oBAAoB;EAClB,aAAa;EACb,eAAe;CACjB;CACA,aAAa;EACX,mBAAmB;EACnB,WAAW;EACX,cAAc;EACd,cAAc;CAChB;CACA,mBAAmB;EACjB,OAAO;EACP,aAAa;CACf;CACA,eAAe,EACb,YAAY,SACd;CACA,aAAa,EACX,sBAAsB,QACxB;CACA,WAAW;EACT,oBAAoB;EACpB,gBAAgB;CAClB;CACA,kBAAkB,EAChB,cAAc,mBAChB;CACA,iBAAiB;EACf,cAAc;EACd,aAAa;CACf;CACA,qBAAqB;EACnB,cAAc;EACd,uBAAuB,UAAU,uBAAuB;EACxD,YAAY,OAAO,UACjB,qBAAA,UAAA,EAAA,UAAA;GAAE;GACW;GAAM;GAA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