@octans/ui 1.0.0 → 1.3.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.
Files changed (62) hide show
  1. package/README.md +45 -2
  2. package/dist/components/ActionList/ActionList.vue.d.ts +12 -4
  3. package/dist/components/ActionList/ActionListButton.vue.d.ts +13 -1
  4. package/dist/components/AppFrame/AppFrame.vue.d.ts +3 -3
  5. package/dist/components/Badge/Badge.vue.d.ts +3 -3
  6. package/dist/components/Banner/Banner.vue.d.ts +18 -0
  7. package/dist/components/Button/Button.vue.d.ts +66 -0
  8. package/dist/components/Calendar/types.d.ts +52 -0
  9. package/dist/components/CalendarHeatmap/CalendarHeatmap.vue.d.ts +1 -1
  10. package/dist/components/Card/CardSection.vue.d.ts +1 -1
  11. package/dist/components/ColorSelector/ColorSelector.vue.d.ts +1 -1
  12. package/dist/components/ColorSelector/types.d.ts +2 -2
  13. package/dist/components/DataTable/BulkActions.vue.d.ts +21 -3
  14. package/dist/components/DatePicker/types.d.ts +33 -0
  15. package/dist/components/FileInput/FileInput.vue.d.ts +104 -0
  16. package/dist/components/FileInput/ItemList.vue.d.ts +6 -0
  17. package/dist/components/FileInput/pageDrop.d.ts +23 -0
  18. package/dist/components/Filters/FilterActions.vue.d.ts +21 -3
  19. package/dist/components/Filters/FilterItem.vue.d.ts +31 -3
  20. package/dist/components/Filters/Filters.vue.d.ts +73 -9
  21. package/dist/components/Formatter/Formatter.vue.d.ts +18 -0
  22. package/dist/components/KeyboardKey/KeyboardKey.vue.d.ts +38 -0
  23. package/dist/components/KeyboardKey/index.d.ts +2 -0
  24. package/dist/components/Labelled/Labelled.vue.d.ts +18 -2
  25. package/dist/components/Modal/ModalSection.vue.d.ts +71 -0
  26. package/dist/components/Modal/index.d.ts +2 -1
  27. package/dist/components/Page/Page.vue.d.ts +34 -4
  28. package/dist/components/{Popper/Popper.vue.d.ts → Popover/Popover.vue.d.ts} +4 -4
  29. package/dist/components/Popover/index.d.ts +90 -0
  30. package/dist/components/{Popper → Popover}/types.d.ts +3 -3
  31. package/dist/components/RangeSlider/RangeSlider.vue.d.ts +27 -0
  32. package/dist/components/Select/Select.vue.d.ts +35 -3
  33. package/dist/components/SkeletonPage/SkeletonPage.vue.d.ts +19 -0
  34. package/dist/components/SkeletonPage/index.d.ts +2 -0
  35. package/dist/components/SkeletonPage/types.d.ts +26 -0
  36. package/dist/components/Tabs/Tabs.vue.d.ts +1 -14
  37. package/dist/components/Tabs/types.d.ts +11 -1
  38. package/dist/components/Tag/Tag.vue.d.ts +3 -3
  39. package/dist/components/TextField/types.d.ts +10 -0
  40. package/dist/components/TimePicker/types.d.ts +10 -0
  41. package/dist/components/ToggleSwitch/ToggleSwitch.vue.d.ts +8 -2
  42. package/dist/components/ToggleSwitch/types.d.ts +29 -0
  43. package/dist/components/Tooltip/Tooltip.vue.d.ts +2 -2
  44. package/dist/components/all.d.ts +3 -1
  45. package/dist/components/types.d.ts +5 -0
  46. package/dist/lib.d.ts +4 -1
  47. package/dist/reset.css +73 -0
  48. package/dist/style.css +1 -1
  49. package/dist/ui.js +4255 -3770
  50. package/dist/ui.umd.js +3 -3
  51. package/dist/utils/color.d.ts +11 -0
  52. package/dist/utils/contrastPairs.d.ts +39 -0
  53. package/dist/utils/createTheme.d.ts +29 -0
  54. package/dist/utils/customTheme.d.ts +1 -1
  55. package/dist/utils/date.d.ts +12 -1
  56. package/dist/utils/format.d.ts +8 -0
  57. package/dist/utils/positionPanel.d.ts +2 -2
  58. package/dist/utils/radix.d.ts +2 -2
  59. package/dist/utils/tokens.d.ts +1 -1
  60. package/package.json +29 -24
  61. package/skills/octans-ui/SKILL.md +303 -0
  62. package/dist/components/Popper/index.d.ts +0 -2
@@ -1,4 +1,33 @@
1
1
  export interface ToggleSwitchProps {
2
+ /**
3
+ * The title of the field, drawn above the switch.
4
+ *
5
+ * A switch with any of `label` / `error` / `helpText` / `helpTextHtml` /
6
+ * `helpLink` set is wrapped in `Labelled`, like every other form control in
7
+ * the library. Without them the markup is the bare switch, as it always was.
8
+ */
9
+ label?: string | false | null;
10
+ /**
11
+ * Displays the value as an error message below the switch.
12
+ */
13
+ error?: string | false | null;
14
+ /**
15
+ * Displays the value as help text below the switch.
16
+ */
17
+ helpText?: string | false | null;
18
+ /**
19
+ * Renders help text as raw HTML. Use with caution.
20
+ */
21
+ helpTextHtml?: string | false | null;
22
+ /**
23
+ * Renders a help icon next to the label which links to an external page.
24
+ */
25
+ helpLink?: string | false | null;
26
+ /**
27
+ * Marks the field as required: an asterisk after the label, and
28
+ * `aria-required` on the switch.
29
+ */
30
+ required?: boolean;
2
31
  /**
3
32
  * The bound value / v-model.
4
33
  */
@@ -1,6 +1,6 @@
1
- import { PopperPlacementType } from '../Popper';
1
+ import { PopoverPlacementType } from '../Popover';
2
2
  export interface TooltipProps {
3
- placement?: PopperPlacementType;
3
+ placement?: PopoverPlacementType;
4
4
  content?: string;
5
5
  }
6
6
  declare var __VLS_26: {}, __VLS_34: {};
@@ -39,6 +39,7 @@ export * from './GradientPicker';
39
39
  export * from './Heading';
40
40
  export * from './Icon';
41
41
  export * from './InlineError';
42
+ export * from './KeyboardKey';
42
43
  export * from './Labelled';
43
44
  export * from './Layout';
44
45
  export * from './Link';
@@ -54,7 +55,7 @@ export * from './OtpInput';
54
55
  export * from './Page';
55
56
  export * from './PageActions';
56
57
  export * from './Pagination';
57
- export * from './Popper';
58
+ export * from './Popover';
58
59
  export * from './PreventAutoComplete';
59
60
  export * from './ProgressBar';
60
61
  export * from './RadioButton';
@@ -69,6 +70,7 @@ export * from './Sheet';
69
70
  export * from './SkeletonBodyText';
70
71
  export * from './SkeletonCard';
71
72
  export * from './SkeletonDisplayText';
73
+ export * from './SkeletonPage';
72
74
  export * from './Spinner';
73
75
  export * from './Splitter';
74
76
  export * from './Stack';
@@ -10,6 +10,11 @@ export interface ActionType {
10
10
  type?: ActionTypeType;
11
11
  icon?: string;
12
12
  disabled?: boolean;
13
+ /**
14
+ * Swaps the button's label for a spinner while the action is in flight.
15
+ * `disabled` already stops a second submit; this is what SAYS so.
16
+ */
17
+ loading?: boolean;
13
18
  url?: string;
14
19
  tooltip?: string;
15
20
  tooltipPosition?: ActionTooltipPositionType;
package/dist/lib.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { format } from './utils/format';
2
- import { setLocale } from './utils/date';
2
+ import { setLocale, setTimezone, getTimezone } from './utils/date';
3
3
  import { setTheme, toggleTheme, getResolvedTheme, getThemePreference, onThemeChange, persistTheme } from './utils/theme';
4
4
  import { translate, setTranslations, addTranslations, setTranslationLocale, getTranslationLocale, getAvailableLocales, TranslationDictionary } from './utils/translate';
5
5
  import * as components from './components/all';
@@ -12,6 +12,7 @@ interface PluginOptions {
12
12
  }
13
13
  export * from './components/all';
14
14
  export { addCollection, addIcon } from '@iconify/vue';
15
+ export { setTimezone, getTimezone } from './utils/date';
15
16
  export { translate, $t, setTranslations, addTranslations, setTranslationLocale, getTranslationLocale, getAvailableLocales, type TranslationDictionary } from './utils/translate';
16
17
  export { setTheme, toggleTheme, getResolvedTheme, getThemePreference, onThemeChange, persistTheme, type ThemeType, type ThemePreferenceType } from './utils/theme';
17
18
  export { listCustomThemes, getCustomTheme, saveCustomTheme, deleteCustomTheme, applyCustomTheme, clearCustomTheme, restoreCustomTheme, getActiveCustomThemeId, getResolvedTokenValue, exportCustomTheme, importCustomTheme, createThemeId, ThemeImportError, type CustomTheme } from './utils/customTheme';
@@ -29,6 +30,8 @@ declare const UI: {
29
30
  setLocale: typeof setLocale;
30
31
  translate: typeof translate;
31
32
  t: typeof translate;
33
+ setTimezone: typeof setTimezone;
34
+ getTimezone: typeof getTimezone;
32
35
  setTranslations: typeof setTranslations;
33
36
  addTranslations: typeof addTranslations;
34
37
  setTranslationLocale: typeof setTranslationLocale;
package/dist/reset.css ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Octans page reset — OPT IN.
3
+ *
4
+ * import '@octans/ui/style.css'
5
+ * import '@octans/ui/reset.css' // only when Octans owns the whole page
6
+ *
7
+ * The main stylesheet deliberately resets nothing outside `.UIElement`, so the
8
+ * library can be dropped into a page it doesn't own without moving anything.
9
+ * That is the right default, and it is the wrong one for an app where Octans
10
+ * IS the UI: everything the app renders itself — the shell, the layout
11
+ * wrappers, the nav — silently falls back to browser defaults. Serif text,
12
+ * the user agent's 8px body margin, `content-box` sizing, and a body with no
13
+ * height so it grows past the viewport and earns a second scrollbar.
14
+ *
15
+ * This file is that missing layer and nothing more. It is deliberately small:
16
+ * it states the four things the UA gets wrong for a full-page app, and leaves
17
+ * everything else — image display, list markers, heading sizes — alone.
18
+ *
19
+ * THIS FILE IS PLAIN CSS AND IS COPIED TO dist/ VERBATIM. It is not part of
20
+ * the JS graph, so it cannot use Sass, and every token it reads carries a
21
+ * literal fallback for the case where it is imported without `style.css`.
22
+ */
23
+
24
+ *,
25
+ *::before,
26
+ *::after {
27
+ box-sizing: border-box;
28
+ }
29
+
30
+ /* `height` on the root so percentages below it resolve; `min-height` — not
31
+ `height` — on the body, so a document taller than the viewport still
32
+ scrolls normally instead of overflowing a fixed-height box. */
33
+ html {
34
+ height: 100%;
35
+ }
36
+
37
+ body {
38
+ min-height: 100%;
39
+ margin: 0;
40
+ padding: 0;
41
+ background-color: var(--octans-surface-app, #eff1f5);
42
+ color: var(--octans-text, #2c333d);
43
+ font-family: var(
44
+ --octans-font,
45
+ system-ui,
46
+ -apple-system,
47
+ 'Segoe UI',
48
+ Roboto,
49
+ 'Noto Sans',
50
+ 'Liberation Sans',
51
+ Arial,
52
+ sans-serif,
53
+ 'Apple Color Emoji',
54
+ 'Segoe UI Emoji'
55
+ );
56
+ /* Matches `.UIElement`. Without it, app-authored markup renders at the UA's
57
+ 16px directly beside 14px Octans components. */
58
+ font-size: 14px;
59
+ -webkit-font-smoothing: antialiased;
60
+ }
61
+
62
+ /* Form controls inherit neither font nor colour — the trap the skill
63
+ documents at component level, applied once at page level. `font: inherit`
64
+ rather than `font-family` alone, because size, weight and line-height are
65
+ all reset by the UA too. */
66
+ button,
67
+ input,
68
+ select,
69
+ textarea,
70
+ optgroup {
71
+ font: inherit;
72
+ color: inherit;
73
+ }