@nordmanai/nif 0.2.11 → 0.2.13
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/index.d.ts +1 -0
- package/dist/index.js +2735 -2713
- package/dist/styles.css +1 -1
- package/dist/ui/components/nm-button/nm-button.d.ts +3 -0
- package/dist/ui/components/nm-composer/nm-composer.d.ts +3 -0
- package/dist/ui/components/nm-sidebar/nm-sidebar.d.ts +8 -2
- package/dist/ui/components/nm-small-icon-button/nm-small-icon-button.d.ts +5 -0
- package/dist/ui/components/nordman-icon-button/nordman-icon-button.d.ts +3 -0
- package/dist/ui/config/nm-button.d.ts +1 -0
- package/dist/ui/config/nm-composer.d.ts +2 -4
- package/dist/ui/config/nm-icon-button.d.ts +4 -2
- package/dist/ui/config/nm-shape.d.ts +11 -0
- package/package.json +1 -1
- package/registry/index.json +28 -1
- package/registry/ui/components/nm-button/nm-button.css +3 -0
- package/registry/ui/components/nm-button/nm-button.tsx +5 -1
- package/registry/ui/components/nm-composer/nm-composer.css +9 -2
- package/registry/ui/components/nm-composer/nm-composer.tsx +6 -1
- package/registry/ui/components/nm-sidebar/nm-sidebar.css +2 -1
- package/registry/ui/components/nm-sidebar/nm-sidebar.tsx +22 -3
- package/registry/ui/components/nm-small-icon-button/nm-small-icon-button.tsx +5 -0
- package/registry/ui/components/nordman-icon-button/nordman-icon-button.css +3 -0
- package/registry/ui/components/nordman-icon-button/nordman-icon-button.tsx +7 -1
- package/registry/ui/config/nm-button.ts +1 -0
- package/registry/ui/config/nm-composer.ts +3 -0
- package/registry/ui/config/nm-icon-button.ts +11 -5
- package/registry/ui/config/nm-shape.ts +11 -0
- package/registry/ui/styles/tokens.css +2 -0
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Composer: the message box. Built from the Nordman AI design:
|
|
3
3
|
* one framed box, the text on top, actions in a row beneath. Add on the left, dictate and voice on the right.
|
|
4
4
|
*/
|
|
5
|
+
import { NM_SHAPE_ATTRIBUTE } from './nm-shape.ts';
|
|
5
6
|
export const NM_COMPOSER_COPY = {
|
|
6
7
|
placeholder: 'Ask Nordman',
|
|
7
8
|
attach: 'Add',
|
|
@@ -44,6 +45,8 @@ export const NM_COMPOSER_CLASSES = {
|
|
|
44
45
|
primary: 'nm-composer__button--primary',
|
|
45
46
|
stopMark: 'nm-composer__stop-mark',
|
|
46
47
|
} as const;
|
|
48
|
+
/** Set on the root with a shape value; every button in the bar, own or hosted, takes that shape. */
|
|
49
|
+
export const NM_COMPOSER_SHAPE_ATTRIBUTE = NM_SHAPE_ATTRIBUTE;
|
|
47
50
|
|
|
48
51
|
export type NmComposerAttachment = { id: string; name: string };
|
|
49
52
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { NM_CONTROL_SHAPES, type NmControlShape } from './nm-shape.ts';
|
|
1
2
|
export const NM_ICON_BUTTON_TONES = {
|
|
2
3
|
line: 'line',
|
|
3
4
|
raised: 'raised',
|
|
@@ -19,15 +20,20 @@ export const NM_ICON_BUTTON_CLASSES = {
|
|
|
19
20
|
solid: 'nm-icon-button--solid',
|
|
20
21
|
panel: 'nm-icon-button--panel',
|
|
21
22
|
invert: 'nm-icon-button--invert',
|
|
23
|
+
round: 'nm-icon-button--round',
|
|
22
24
|
} as const;
|
|
23
25
|
|
|
24
26
|
/** Shared geometry hook for send / stop / during-run primary composer actions. */
|
|
25
27
|
export const NM_CHATBOX_ACTION_CLASS = 'nm-chatbox__send';
|
|
26
28
|
|
|
27
|
-
export function nmIconButtonClassName(
|
|
28
|
-
|
|
29
|
+
export function nmIconButtonClassName(
|
|
30
|
+
tone: NmIconButtonTone = NM_ICON_BUTTON_TONES.quiet,
|
|
31
|
+
shape?: NmControlShape,
|
|
32
|
+
): string {
|
|
33
|
+
const base = `${NM_ICON_BUTTON_CLASSES.root} ${NM_ICON_BUTTON_CLASSES[tone]}`;
|
|
34
|
+
return shape === NM_CONTROL_SHAPES.round ? `${base} ${NM_ICON_BUTTON_CLASSES.round}` : base;
|
|
29
35
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
return `${
|
|
36
|
+
export function nmChatboxActionButtonClassName(shape?: NmControlShape): string {
|
|
37
|
+
const base = `${NM_ICON_BUTTON_CLASSES.root} ${NM_ICON_BUTTON_CLASSES.invert} ${NM_CHATBOX_ACTION_CLASS}`;
|
|
38
|
+
return shape === NM_CONTROL_SHAPES.round ? `${base} ${NM_ICON_BUTTON_CLASSES.round}` : base;
|
|
33
39
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Control shape. Soft is the kit default: corners follow the themed radius scale.
|
|
3
|
+
* Round is a full circle (or pill): it ignores the radius scale, a circle has no corner to scale.
|
|
4
|
+
*/
|
|
5
|
+
export const NM_CONTROL_SHAPES = {
|
|
6
|
+
soft: 'soft',
|
|
7
|
+
round: 'round',
|
|
8
|
+
} as const;
|
|
9
|
+
export type NmControlShape = (typeof NM_CONTROL_SHAPES)[keyof typeof NM_CONTROL_SHAPES];
|
|
10
|
+
/** The data attribute a container sets to round every control inside it. */
|
|
11
|
+
export const NM_SHAPE_ATTRIBUTE = 'data-button-shape';
|
|
@@ -93,6 +93,8 @@
|
|
|
93
93
|
--nm-radius-sm: calc(4px * var(--nm-radius-scale));
|
|
94
94
|
--nm-radius-md: calc(8px * var(--nm-radius-scale));
|
|
95
95
|
--nm-radius-lg: calc(12px * var(--nm-radius-scale));
|
|
96
|
+
/* A full circle or pill. Not scaled: a circle has no corner. */
|
|
97
|
+
--nm-radius-round: 9999px;
|
|
96
98
|
/* 100% by default. The Space setting scales every spacing token. */
|
|
97
99
|
--nm-space-scale: 1;
|
|
98
100
|
--nm-space-2: calc(0.125rem * var(--nm-space-scale));
|