@optimum-intelligence/opti-ui 0.7.6 → 0.8.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.
- package/CHANGELOG.md +121 -0
- package/README.md +20 -10
- package/dist/components/alert/Alert.d.ts +5 -2
- package/dist/components/alert/Alert.js +67 -65
- package/dist/components/alert/Alert.js.map +1 -1
- package/dist/components/app-shell/AppShell.d.ts +25 -8
- package/dist/components/app-shell/AppShell.js +428 -397
- package/dist/components/app-shell/AppShell.js.map +1 -1
- package/dist/components/breadcrumbs/Breadcrumbs.d.ts +6 -1
- package/dist/components/breadcrumbs/Breadcrumbs.js +42 -40
- package/dist/components/breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/calendar/Calendar.js +140 -136
- package/dist/components/calendar/Calendar.js.map +1 -1
- package/dist/components/combobox/Combobox.d.ts +9 -3
- package/dist/components/combobox/Combobox.js +220 -231
- package/dist/components/combobox/Combobox.js.map +1 -1
- package/dist/components/command-palette/CommandPalette.d.ts +13 -4
- package/dist/components/command-palette/CommandPalette.js +91 -89
- package/dist/components/command-palette/CommandPalette.js.map +1 -1
- package/dist/components/data-table/DataTable.d.ts +51 -17
- package/dist/components/data-table/DataTable.js +489 -278
- package/dist/components/data-table/DataTable.js.map +1 -1
- package/dist/components/data-table/DataTableContent.d.ts +7 -1
- package/dist/components/data-table/DataTableContent.js +247 -211
- package/dist/components/data-table/DataTableContent.js.map +1 -1
- package/dist/components/data-table/DataTableFilters.d.ts +56 -4
- package/dist/components/data-table/DataTableFilters.js +493 -77
- package/dist/components/data-table/DataTableFilters.js.map +1 -1
- package/dist/components/data-table/layout.d.ts +5 -0
- package/dist/components/data-table/layout.js +23 -1
- package/dist/components/data-table/layout.js.map +1 -1
- package/dist/components/data-table/types.d.ts +35 -2
- package/dist/components/data-table/useDataTable.d.ts +1 -1
- package/dist/components/data-table/useDataTable.js +386 -332
- package/dist/components/data-table/useDataTable.js.map +1 -1
- package/dist/components/date-picker/DatePicker.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.js +148 -140
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/components/date-picker/DateRangePicker.d.ts +2 -0
- package/dist/components/date-picker/DateRangePicker.js +171 -164
- package/dist/components/date-picker/DateRangePicker.js.map +1 -1
- package/dist/components/date-picker/PickerField.d.ts +6 -3
- package/dist/components/date-picker/PickerField.js +166 -159
- package/dist/components/date-picker/PickerField.js.map +1 -1
- package/dist/components/dialog/ConfirmDialog.d.ts +5 -2
- package/dist/components/dialog/ConfirmDialog.js +79 -77
- package/dist/components/dialog/ConfirmDialog.js.map +1 -1
- package/dist/components/dialog/Dialog.d.ts +5 -2
- package/dist/components/dialog/Dialog.js +65 -63
- package/dist/components/dialog/Dialog.js.map +1 -1
- package/dist/components/drawer/Drawer.d.ts +13 -4
- package/dist/components/drawer/Drawer.js +122 -164
- package/dist/components/drawer/Drawer.js.map +1 -1
- package/dist/components/field/Field.d.ts +38 -9
- package/dist/components/field/Field.js +66 -1
- package/dist/components/field/Field.js.map +1 -1
- package/dist/components/file-upload/FileUpload.js +2 -0
- package/dist/components/file-upload/FileUpload.js.map +1 -1
- package/dist/components/input/Input.d.ts +9 -16
- package/dist/components/input/Input.js +124 -206
- package/dist/components/input/Input.js.map +1 -1
- package/dist/components/map/colors.d.ts +2 -2
- package/dist/components/map/colors.js +12 -3
- package/dist/components/map/colors.js.map +1 -1
- package/dist/components/number-field/NumberField.d.ts +12 -3
- package/dist/components/number-field/NumberField.js +109 -130
- package/dist/components/number-field/NumberField.js.map +1 -1
- package/dist/components/pagination/Pagination.js +135 -186
- package/dist/components/pagination/Pagination.js.map +1 -1
- package/dist/components/progress/Progress.d.ts +2 -1
- package/dist/components/progress/Progress.js.map +1 -1
- package/dist/components/search-input/SearchInput.d.ts +5 -2
- package/dist/components/search-input/SearchInput.js +47 -45
- package/dist/components/search-input/SearchInput.js.map +1 -1
- package/dist/components/select/Select.d.ts +13 -3
- package/dist/components/select/Select.js +144 -139
- package/dist/components/select/Select.js.map +1 -1
- package/dist/components/spinner/Spinner.d.ts +6 -2
- package/dist/components/spinner/Spinner.js +42 -40
- package/dist/components/spinner/Spinner.js.map +1 -1
- package/dist/components/stat-card/StatCard.d.ts +7 -2
- package/dist/components/stat-card/StatCard.js +1 -1
- package/dist/components/stat-card/StatCard.js.map +1 -1
- package/dist/components/stepper/Stepper.js +44 -40
- package/dist/components/stepper/Stepper.js.map +1 -1
- package/dist/components/toast/Toast.d.ts +17 -1
- package/dist/components/toast/Toast.js +65 -33
- package/dist/components/toast/Toast.js.map +1 -1
- package/dist/components.json +475 -68
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +12 -1
- package/dist/icons/index.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -4
- package/dist/labels/Labels.d.ts +93 -0
- package/dist/labels/Labels.js +96 -0
- package/dist/labels/Labels.js.map +1 -0
- package/dist/labels/hu.d.ts +17 -0
- package/dist/labels/hu.js +124 -0
- package/dist/labels/hu.js.map +1 -0
- package/dist/llms-full.txt +274 -48
- package/dist/llms.txt +11 -4
- package/dist/opti-ui.css +370 -47
- package/dist/theme/ThemeProvider.d.ts +8 -4
- package/dist/theme/ThemeProvider.js.map +1 -1
- package/dist/utils/media.d.ts +9 -2
- package/dist/utils/media.js +10 -3
- package/dist/utils/media.js.map +1 -1
- package/package.json +5 -2
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Token or component variable name without the `--oui-` prefix, e.g. `color-accent`, `space-8`,
|
|
4
|
+
* `card-padding` or `navbar-width`. Any name is accepted, because component variables follow no single pattern.
|
|
5
|
+
*/
|
|
6
|
+
export type ThemeTokenName = string;
|
|
4
7
|
/** A partial set of token overrides. Values are any valid CSS value. */
|
|
5
8
|
export type Theme = Partial<Record<ThemeTokenName, string>>;
|
|
6
|
-
|
|
9
|
+
/** Colour mode of a subtree. `system` follows the OS setting (`prefers-color-scheme`) and switches with it. */
|
|
10
|
+
export type ColorMode = 'light' | 'dark' | 'system';
|
|
7
11
|
/** Converts a theme object into CSS custom properties for a `style` prop. */
|
|
8
12
|
export declare function themeToStyle(theme: Theme | undefined): React.CSSProperties;
|
|
9
13
|
/** Builds a theme from a base, applying overrides on top. */
|
|
@@ -13,7 +17,7 @@ export interface ThemeProviderProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
13
17
|
ref?: React.Ref<HTMLDivElement>;
|
|
14
18
|
/** Token overrides applied to this subtree. */
|
|
15
19
|
theme?: Theme;
|
|
16
|
-
/** Color mode for this subtree. */
|
|
20
|
+
/** Color mode for this subtree; `system` follows the OS. Left out, the subtree inherits its ancestor's mode. */
|
|
17
21
|
mode?: ColorMode;
|
|
18
22
|
}
|
|
19
23
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeProvider.js","names":["React","PortalContainerContext","cx","ThemeTokenName","Theme","Partial","Record","ColorMode","themeToStyle","theme","CSSProperties","style","name","value","Object","entries","createTheme","themes","assign","ThemeProviderProps","HTMLAttributes","HTMLDivElement","ref","Ref","mode","ThemeProvider","t0","$","_c","children","className","props","container","setContainer","useState","t1","t2","t3","t4","t5","Symbol","for","t6","_c"],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PortalContainerContext } from '../utils/portal';\nimport { cx } from '../utils/cx';\n\n
|
|
1
|
+
{"version":3,"file":"ThemeProvider.js","names":["React","PortalContainerContext","cx","ThemeTokenName","Theme","Partial","Record","ColorMode","themeToStyle","theme","CSSProperties","style","name","value","Object","entries","createTheme","themes","assign","ThemeProviderProps","HTMLAttributes","HTMLDivElement","ref","Ref","mode","ThemeProvider","t0","$","_c","children","className","props","container","setContainer","useState","t1","t2","t3","t4","t5","Symbol","for","t6","_c"],"sources":["../../src/theme/ThemeProvider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { PortalContainerContext } from '../utils/portal';\nimport { cx } from '../utils/cx';\n\n/**\n * Token or component variable name without the `--oui-` prefix, e.g. `color-accent`, `space-8`,\n * `card-padding` or `navbar-width`. Any name is accepted, because component variables follow no single pattern.\n */\nexport type ThemeTokenName = string;\n\n/** A partial set of token overrides. Values are any valid CSS value. */\nexport type Theme = Partial<Record<ThemeTokenName, string>>;\n\n/** Colour mode of a subtree. `system` follows the OS setting (`prefers-color-scheme`) and switches with it. */\nexport type ColorMode = 'light' | 'dark' | 'system';\n\n/** Converts a theme object into CSS custom properties for a `style` prop. */\nexport function themeToStyle(theme: Theme | undefined): React.CSSProperties {\n const style: Record<string, string> = {};\n if (!theme) return style;\n for (const [name, value] of Object.entries(theme)) {\n if (value != null && value !== '') style[`--oui-${name}`] = value;\n }\n return style as React.CSSProperties;\n}\n\n/** Builds a theme from a base, applying overrides on top. */\nexport function createTheme(...themes: Theme[]): Theme {\n return Object.assign({}, ...themes);\n}\n\nexport interface ThemeProviderProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Ref to the provider's root element. */\n ref?: React.Ref<HTMLDivElement>;\n /** Token overrides applied to this subtree. */\n theme?: Theme;\n /** Color mode for this subtree; `system` follows the OS. Left out, the subtree inherits its ancestor's mode. */\n mode?: ColorMode;\n}\n\n/**\n * Scopes a theme to its children. Popups opened inside are portalled into the\n * provider so they pick up the same tokens.\n */\nexport function ThemeProvider({ theme, mode, className, style, children, ref, ...props }: ThemeProviderProps) {\n const [container, setContainer] = React.useState<HTMLDivElement | null>(null);\n return (\n <div\n ref={ref}\n className={cx('oui-theme', className)}\n data-oui-theme={mode}\n style={{ ...themeToStyle(theme), ...style }}\n {...props}\n >\n <PortalContainerContext value={container}>{children}</PortalContainerContext>\n <div className=\"oui-theme__portal\" ref={setContainer} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAiBA,SAAgBQ,aAAaC,OAA+C;CAC1E,MAAME,QAAgC,CAAC;CACvC,IAAI,CAACF,OAAO,OAAOE;CACnB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hB,SAAAgB,EAAA,QAAAS,IAAA;EAAxBC,KAAA;GAAA,GAAKD;GAAmB,GAAKzB;EAAM;EAACgB,EAAA,MAAAhB;EAAAgB,EAAA,MAAAS;EAAAT,EAAA,MAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,IAAAW;CAAA,IAAAX,EAAA,QAAAE,YAAAF,EAAA,QAAAK,WAAA;EAG3CM,KAAA,oBAAC,wBAAD;GAA+BN,OAAAA;GAAYH;EAApB,CAAA;EAAsDF,EAAA,MAAAE;EAAAF,EAAA,MAAAK;EAAAL,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAY;CAAA,IAAAZ,EAAA,QAAAa,OAAAC,IAAA,2BAAA,GAAA;EAC7EF,KAAA,oBAAA,OAAA;GAAe,WAAA;GAAyBN,KAAAA;EAAY,CAAA;EAAIN,EAAA,MAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAH,QAAAG,EAAA,QAAAI,SAAAJ,EAAA,QAAAL,OAAAK,EAAA,QAAAQ,MAAAR,EAAA,QAAAU,MAAAV,EAAA,QAAAW,IAAA;EAR1DI,KAAA,qBAAA,OAAA;GACOpB;GACM,WAAAa;GACKX,kBAAAA;GACT,OAAAa;GAAoC,GACvCN;GALN,UAAA,CAOEO,IACAC,EACI;;EAAAZ,EAAA,MAAAH;EAAAG,EAAA,MAAAI;EAAAJ,EAAA,MAAAL;EAAAK,EAAA,MAAAQ;EAAAR,EAAA,MAAAU;EAAAV,EAAA,MAAAW;EAAAX,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OATNe;AASM"}
|
package/dist/utils/media.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Media query for phones, which get their own layout at and below 640px. Pass it to `useMediaQuery`. */
|
|
2
2
|
export declare const NARROW_SCREEN = "(max-width: 640px)";
|
|
3
|
-
/**
|
|
3
|
+
/** Media query for screens where `AppShell` moves its navbar into a drawer and shows the tab bar (900px and below). */
|
|
4
|
+
export declare const SHELL_COLLAPSED = "(max-width: 900px)";
|
|
5
|
+
/**
|
|
6
|
+
* Whether a media query matches, following changes. `false` during server rendering.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* const phone = useMediaQuery(NARROW_SCREEN);
|
|
10
|
+
*/
|
|
4
11
|
export declare function useMediaQuery(query: string): boolean;
|
package/dist/utils/media.js
CHANGED
|
@@ -2,9 +2,16 @@
|
|
|
2
2
|
import { c } from "react/compiler-runtime";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
//#region src/utils/media.ts
|
|
5
|
-
/**
|
|
5
|
+
/** Media query for phones, which get their own layout at and below 640px. Pass it to `useMediaQuery`. */
|
|
6
6
|
var NARROW_SCREEN = "(max-width: 640px)";
|
|
7
|
-
/**
|
|
7
|
+
/** Media query for screens where `AppShell` moves its navbar into a drawer and shows the tab bar (900px and below). */
|
|
8
|
+
var SHELL_COLLAPSED = "(max-width: 900px)";
|
|
9
|
+
/**
|
|
10
|
+
* Whether a media query matches, following changes. `false` during server rendering.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* const phone = useMediaQuery(NARROW_SCREEN);
|
|
14
|
+
*/
|
|
8
15
|
function useMediaQuery(query) {
|
|
9
16
|
const $ = c(3);
|
|
10
17
|
let t0;
|
|
@@ -29,6 +36,6 @@ function _temp() {
|
|
|
29
36
|
return false;
|
|
30
37
|
}
|
|
31
38
|
//#endregion
|
|
32
|
-
export { NARROW_SCREEN, useMediaQuery };
|
|
39
|
+
export { NARROW_SCREEN, SHELL_COLLAPSED, useMediaQuery };
|
|
33
40
|
|
|
34
41
|
//# sourceMappingURL=media.js.map
|
package/dist/utils/media.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"media.js","names":["React","NARROW_SCREEN","useMediaQuery","query","$","_c","t0","t1","notify","list","window","matchMedia","addEventListener","removeEventListener","matches","useSyncExternalStore","_temp","_c"],"sources":["../../src/utils/media.ts"],"sourcesContent":["import * as React from 'react';\n\n/**
|
|
1
|
+
{"version":3,"file":"media.js","names":["React","NARROW_SCREEN","SHELL_COLLAPSED","useMediaQuery","query","$","_c","t0","t1","notify","list","window","matchMedia","addEventListener","removeEventListener","matches","useSyncExternalStore","_temp","_c"],"sources":["../../src/utils/media.ts"],"sourcesContent":["import * as React from 'react';\n\n/** Media query for phones, which get their own layout at and below 640px. Pass it to `useMediaQuery`. */\nexport const NARROW_SCREEN = '(max-width: 640px)';\n\n/** Media query for screens where `AppShell` moves its navbar into a drawer and shows the tab bar (900px and below). */\nexport const SHELL_COLLAPSED = '(max-width: 900px)';\n\n/**\n * Whether a media query matches, following changes. `false` during server rendering.\n *\n * @example\n * const phone = useMediaQuery(NARROW_SCREEN);\n */\nexport function useMediaQuery(query: string) {\n return React.useSyncExternalStore(\n (notify) => {\n const list = window.matchMedia(query);\n list.addEventListener('change', notify);\n return () => list.removeEventListener('change', notify);\n },\n () => window.matchMedia(query).matches,\n () => false,\n );\n}\n"],"mappings":";;;;;AAGA,IAAaC,gBAAgB;;AAG7B,IAAaC,kBAAkB;;;;;;;AAQ/B,SAAOC,cAAAC,OAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAH,EAAA,OAAAD,OAAA;EAEHG,MAAAE,WAAA;GACE,MAAAC,OAAaC,OAAMC,WAAYR,KAAK;GACpCM,KAAIG,iBAAkB,UAAUJ,MAAM;GAAC,aAC1BC,KAAII,oBAAqB,UAAUL,MAAM;EAAC;EAEzDD,WAAMG,OAAMC,WAAYR,KAAK,CAAC,CAAAW;EAAQV,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;CAAA,OAAA;EAAAD,KAAAF,EAAA;EAAAG,KAAAH,EAAA;CAAA;CAAA,OANjCL,MAAKgB,qBACVT,IAKAC,IACAS,KACF;AAAC;AATI,SAAAA,QAAA;CAAA,OAQG;AAAK"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@optimum-intelligence/opti-ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Optimum's customizable React component library, built on Base UI.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Optimum Intelligence",
|
|
@@ -51,9 +51,12 @@
|
|
|
51
51
|
"build": "npm run typecheck && vite build && tsc -p tsconfig.build.json && npm run docs",
|
|
52
52
|
"docs": "node scripts/generate-docs.mjs",
|
|
53
53
|
"build:showcase": "vite build --mode showcase",
|
|
54
|
-
"test": "npm run build && node --test tests
|
|
54
|
+
"test": "npm run build && node --test tests/*.test.mjs",
|
|
55
55
|
"prepack": "npm run build"
|
|
56
56
|
},
|
|
57
|
+
"engines": {
|
|
58
|
+
"node": "^20.19.0 || >=22.12.0"
|
|
59
|
+
},
|
|
57
60
|
"peerDependencies": {
|
|
58
61
|
"react": "^19.0.0",
|
|
59
62
|
"react-dom": "^19.0.0"
|