@kirana-ui/angular 0.2.0 → 0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kirana-ui/angular",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Kirana UI Primitives for Angular",
5
5
  "license": "MIT",
6
6
  "author": "The Kirana authors",
@@ -22,7 +22,7 @@
22
22
  "./package.json": "./package.json"
23
23
  },
24
24
  "dependencies": {
25
- "@kirana-ui/core": "0.2.0",
25
+ "@kirana-ui/core": "0.3.0",
26
26
  "tslib": "^2.8.1"
27
27
  },
28
28
  "peerDependencies": {
@@ -33,10 +33,16 @@ from one core. The package for a framework is all a project installs.
33
33
  A popup that is placed against its trigger (a popover, a menu, a select, a combobox, a
34
34
  tooltip, a hover card) is `Portal > Positioner > Popup`: the `Positioner` takes `side`
35
35
  (also `inline-start` and `inline-end`, which turn with the reading direction, and which
36
- `data-side` then says), `align`, `sideOffset`, `alignOffset`, `collisionPadding`, and
36
+ `data-side` then says), `align`, `sideOffset` and `alignOffset` (a number, or a function
37
+ of the anchor's and the positioner's sizes), `collisionPadding` (a number, or one a side),
38
+ `collisionBoundary`, `collisionAvoidance`, `sticky`, `arrowPadding`, `positionMethod`, and
37
39
  `anchor` for another element than its trigger to be placed against (an element, the
38
- framework's own ref to one, or a function that gives one). A dialog, an alert dialog and a
39
- drawer have no positioner: `Portal > Backdrop` and `Popup`, placed by the design.
40
+ framework's own ref to one, or a function that gives one). A popup that holds an `Arrow`
41
+ is given `position: relative`, so the arrow is placed in it through its entrance and
42
+ after. A popover may have a `Backdrop` in its portal, is `modal` (`true`: the page is
43
+ inert and does not scroll; `"trap-focus"`: only Tab is kept inside), and its trigger's
44
+ `openOnHover` lets the pointer open it too. A dialog, an alert dialog and a drawer have
45
+ no positioner: `Portal > Backdrop` and `Popup`, placed by the design.
40
46
  3. Style by attributes and variables, never by guessing class names:
41
47
  - a boolean state is present or absent: `[data-open]`, never `[data-open="true"]`;
42
48
  - an entrance starts from `[data-starting-style]`, an exit ends at
@@ -55,8 +61,8 @@ from one core. The package for a framework is all a project installs.
55
61
  Per framework: React takes `render` for another element; Vue takes `as` / `as-child`, binds
56
62
  with `v-model:value` and names props in kebab case; Svelte takes a `child` snippet and
57
63
  `bind:value`; Solid takes `as` and `render`; Angular's parts are directives on your own
58
- elements (`<button kuiDialogTrigger>`), bound with `[(value)]`, with `[kuiId]` for an id, and
59
- a part that comes and goes is structural (`*kuiDialogPortal`, `*kuiTabsPanel`: the list is in
64
+ elements (`<button kpDialogTrigger>`), bound with `[(value)]`, with `[kpId]` for an id, and
65
+ a part that comes and goes is structural (`*kpDialogPortal`, `*kpTabsPanel`: the list is in
60
66
  `llms.txt`); custom elements name each part with `kui-part` inside `<kui-dialog>`.
61
67
 
62
68
  Composing a part with another element: with React's `render={<a … />}` and Vue's `as-child`
@@ -72,9 +78,24 @@ the text a part writes (`Meter.Value`, `Select.Value`) stay inside it on React a
72
78
  `props().children` on Solid, and are given to a Svelte `child` snippet to render
73
79
  (`{ props, state, input }`, `{ props, state, text }`). A handler given to a part is typed
74
80
  with `preventKiranaHandler()` (`PartEvent`, exported by each package). For an element of the
75
- design system's own that takes `render` or `as-child`, use `useRender` and `mergeProps` from
76
- `@kirana-ui/react/use-render`, or `Primitive` from `@kirana-ui/vue/primitive`; never write
77
- another merge.
81
+ design system's own composed as a part is, use `useRender` and `mergeProps` from
82
+ `@kirana-ui/react/use-render`, `Primitive` from `@kirana-ui/vue/primitive`, or `Primitive`
83
+ and `mergeProps` from `@kirana-ui/solid/primitive` and `@kirana-ui/svelte/primitive` (Solid's
84
+ `as` and `render`, Svelte's `as` and `child`, a `state` written as `data-*`); never write
85
+ another merge. On Angular such an element is a directive of your own with host bindings, and
86
+ custom elements need nothing: the page writes its own element.
87
+
88
+ A design system on Angular hosts each primitive in a directive of its own
89
+ (`hostDirectives: [{ directive: KpDialog, inputs: [...], outputs: [...] }]`), exposing what
90
+ its callers set; gives the primitive the rest with `hostInputs(KpTooltip, { delay: () => 0 })`
91
+ in its constructor (each value a function read like a signal, so `computed` values follow;
92
+ an input the element binds wins), never a subclass of the primitive; draws a structural part
93
+ (`kpDialogPortal`) in a component's template around `<ng-content />` (a part given to it finds
94
+ its root where it is written); and names its own directives as it likes, `kui…` included:
95
+ the primitives are `kp…` so that no design system's selector is theirs (two directives with
96
+ one selector both match, silently, and a component whose selector is its host's recurses).
97
+ Tooltips need no provider on any
98
+ framework: a design system passes `delay` on its own tooltip root (`hostInputs` on Angular).
78
99
 
79
100
  ## When something is wrong
80
101