@cscfi/csc-ui 4.0.0-alpha.1 → 4.0.0-alpha.10

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 (50) hide show
  1. package/dist/csc-ui.js +7675 -6821
  2. package/dist/custom-elements.json +1036 -143
  3. package/dist/docs/c-alert/usage.md +24 -0
  4. package/dist/docs/c-checkbox/usage.md +53 -0
  5. package/dist/docs/c-popover/usage.md +33 -0
  6. package/dist/docs/c-progress-bar/usage.md +23 -0
  7. package/dist/docs/c-progress-circle/usage.md +25 -0
  8. package/dist/docs/c-radio/usage.md +45 -0
  9. package/dist/docs/c-radio-group/usage.md +67 -0
  10. package/dist/docs/c-spinner/usage.md +21 -0
  11. package/dist/docs/c-switch/usage.md +36 -0
  12. package/dist/docs/c-table/usage.md +14 -0
  13. package/dist/docs/c-tooltip/usage.md +30 -0
  14. package/dist/styles/css/tailwind-theme.css +31 -0
  15. package/dist/styles/css/tokens.css +282 -201
  16. package/dist/vscode.css-custom-data.json +103 -14
  17. package/dist/vscode.html-custom-data.json +181 -25
  18. package/dist/web-types.json +524 -87
  19. package/dist-types/components/c-alert/CAlert.vue.d.ts +18 -4
  20. package/dist-types/components/c-autocomplete/CAutocomplete.vue.d.ts +4 -1
  21. package/dist-types/components/c-button/CButton.vue.d.ts +1 -1
  22. package/dist-types/components/c-icon/CIcon.vue.d.ts +1 -1
  23. package/dist-types/components/c-icon-button/CIconButton.vue.d.ts +1 -1
  24. package/dist-types/components/c-input/CInput.vue.d.ts +4 -0
  25. package/dist-types/components/c-login-button/CLoginButton.vue.d.ts +4 -2
  26. package/dist-types/components/c-menu/CMenu.vue.d.ts +13 -3
  27. package/dist-types/components/c-menu-item/CMenuItem.vue.d.ts +29 -3
  28. package/dist-types/components/c-popover/CPopover.vue.d.ts +43 -0
  29. package/dist-types/components/c-progress-circle/CProgressCircle.vue.d.ts +32 -0
  30. package/dist-types/components/c-radio/CRadio.vue.d.ts +7 -11
  31. package/dist-types/components/c-radio-group/CRadioGroup.vue.d.ts +8 -46
  32. package/dist-types/components/c-select/CSelect.vue.d.ts +4 -1
  33. package/dist-types/components/c-spinner/CSpinner.vue.d.ts +1 -1
  34. package/dist-types/components/c-table/CTable.vue.d.ts +11 -1
  35. package/dist-types/components/c-table/injectTableStyles.d.ts +1 -0
  36. package/dist-types/components/c-tag/CTag.vue.d.ts +1 -1
  37. package/dist-types/components/c-text-field/CTextField.vue.d.ts +4 -0
  38. package/dist-types/components/c-tooltip/CTooltip.vue.d.ts +49 -0
  39. package/dist-types/index.d.ts +9 -1
  40. package/dist-types/shared/FieldMessage.vue.d.ts +21 -0
  41. package/dist-types/shared/popoverChain.d.ts +62 -0
  42. package/dist-types/shared/positionArea.d.ts +13 -0
  43. package/dist-types/shared/useDesignatedTrigger.d.ts +40 -0
  44. package/dist-types/shared/useHostStates.d.ts +25 -0
  45. package/dist-types/tag-name-map.d.ts +193 -32
  46. package/dist-types/theme/chart-data.d.ts +50 -0
  47. package/dist-types/theme/ramp.d.ts +38 -0
  48. package/dist-types/theme/themeMode.d.ts +13 -0
  49. package/dist-types/types.d.ts +13 -0
  50. package/package.json +8 -6
@@ -0,0 +1,13 @@
1
+ /** The light-or-dark state that selects which palette the semantic tokens resolve to. */
2
+ export type ThemeMode = 'dark' | 'light';
3
+ /**
4
+ * Resolve the theme mode currently in effect, mirroring the cascade in
5
+ * `tokens.css`: an explicit `data-theme` on the root wins (any value other
6
+ * than `dark` is light — `:root:not([data-theme])` is what enables the OS
7
+ * fallback); otherwise the OS preference; light where neither is available
8
+ * (server rendering, no `matchMedia`). Re-run on a `data-theme` mutation and
9
+ * on the `(prefers-color-scheme: dark)` media query's `change` event.
10
+ *
11
+ * @param root the element carrying `data-theme` — defaults to `<html>`
12
+ */
13
+ export declare function themeMode(root?: Element | null): ThemeMode;
@@ -6,6 +6,19 @@
6
6
  *
7
7
  * import type { CSelectItem } from '@cscfi/csc-ui';
8
8
  */
9
+ /**
10
+ * Field height of the form controls built on `c-input`. `default` is the 44px
11
+ * field; `small` is the 36px field. Owned here because the value passes from
12
+ * the wrapping control (`c-select`) into `c-input`.
13
+ */
14
+ export type CFieldSize = 'default' | 'small';
15
+ /**
16
+ * Preferred placement of a floating panel relative to its anchor, shared by
17
+ * the anchor-positioned overlay components (`c-menu`, `c-tooltip`,
18
+ * `c-popover`). The side names the panel's position; `-start`/`-end` align
19
+ * the panel's edge with the anchor's on the cross axis.
20
+ */
21
+ export type CPlacement = 'bottom-end' | 'bottom-start' | 'bottom' | 'left-end' | 'left-start' | 'left' | 'right-end' | 'right-start' | 'right' | 'top-end' | 'top-start' | 'top';
9
22
  /**
10
23
  * A selectable item for the value-selection components (`c-select`,
11
24
  * `c-autocomplete`) when options are supplied via the `items` prop instead of
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cscfi/csc-ui",
3
- "version": "4.0.0-alpha.1",
3
+ "version": "4.0.0-alpha.10",
4
4
  "description": "Vue 3-based replacement for @cscfi/csc-ui — same custom element tag names, Vue v-model contract.",
5
5
  "type": "module",
6
6
  "main": "./dist/csc-ui.js",
@@ -56,19 +56,21 @@
56
56
  "repository": "CSCfi/ui",
57
57
  "homepage": "https://design-system.csc.fi",
58
58
  "scripts": {
59
- "build": "pnpm run style-dictionary:build && pnpm run docs:tag-map && vite build && vue-tsc -p tsconfig.build.json && pnpm run docs:manifest:strict",
59
+ "build": "pnpm run style-dictionary:build && pnpm run chart:generate && pnpm run docs:tag-map && vite build && pnpm run build:types && pnpm run docs:manifest:strict",
60
60
  "docs:manifest": "node scripts/analyzer/index.mjs",
61
61
  "docs:tag-map": "node scripts/analyzer/index.mjs --tag-map",
62
62
  "docs:manifest:strict": "node scripts/analyzer/index.mjs --strict",
63
63
  "docs:seed": "node scripts/seed-descriptions.mjs",
64
- "build:types": "vue-tsc -p tsconfig.build.json",
65
- "build:watch": "pnpm run style-dictionary:build && vue-tsc -p tsconfig.build.json && vite build --watch",
66
- "dev": "pnpm run style-dictionary:build && vue-tsc -p tsconfig.build.json && vite build --watch",
64
+ "build:types": "vue-tsc -p tsconfig.build.json && node scripts/copy-declarations.mjs",
65
+ "build:watch": "pnpm run style-dictionary:build && pnpm run chart:generate && pnpm run build:types && vite build --watch",
66
+ "dev": "pnpm run style-dictionary:build && pnpm run chart:generate && pnpm run build:types && vite build --watch",
67
67
  "lint:a11y": "node scripts/check-host-attr-fallthrough.mjs",
68
68
  "lint:contrast": "node scripts/audit-contrast.mjs",
69
69
  "lint:ramp": "node scripts/check-ramp-parity.mjs",
70
70
  "lint:tokens": "node scripts/check-palette-utilities.mjs",
71
71
  "style-dictionary:build": "style-dictionary build --config ./style-dictionary.config.cjs",
72
- "type-check": "vue-tsc --build --force"
72
+ "type-check": "vue-tsc --build --force",
73
+ "chart:generate": "node scripts/generate-chart-data.mjs",
74
+ "lint:chart": "node scripts/check-chart-parity.mjs"
73
75
  }
74
76
  }