@frame-kit/ui-ng 0.0.1 → 0.0.2
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/COMPONENTS.md +1 -24
- package/DEVELOPMENT_GUIDE.md +4 -5
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs +6 -3
- package/fesm2022/frame-kit-ui-ng-ui-card.mjs.map +1 -1
- package/fesm2022/frame-kit-ui-ng.mjs +0 -2
- package/fesm2022/frame-kit-ui-ng.mjs.map +1 -1
- package/package.json +2 -10
- package/types/frame-kit-ui-ng-ui-card.d.ts +3 -1
- package/types/frame-kit-ui-ng.d.ts +0 -2
- package/ui/card/README.md +27 -7
- package/docs/endpoint-link/README.md +0 -142
- package/docs/method-badge/README.md +0 -154
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs +0 -63
- package/fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs.map +0 -1
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs +0 -43
- package/fesm2022/frame-kit-ui-ng-docs-method-badge.mjs.map +0 -1
- package/types/frame-kit-ui-ng-docs-endpoint-link.d.ts +0 -43
- package/types/frame-kit-ui-ng-docs-method-badge.d.ts +0 -30
package/COMPONENTS.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
FrameKit UI-ng is a token-driven Angular component library that provides a consistent set of building blocks for data entry, layout, navigation, and complex form workflows, all designed to be themeable via `--fk-*` design tokens.
|
|
4
4
|
|
|
5
|
-
Organized by **purpose** (not Atomic Design) into
|
|
5
|
+
Organized by **purpose** (not Atomic Design) into six layers with strict dependency rules — see [the development guide](./DEVELOPMENT_GUIDE.md) for the architecture overview.
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -104,11 +104,6 @@ Organized by **purpose** (not Atomic Design) into seven layers with strict depen
|
|
|
104
104
|
- [fk-app-shell](#fk-app-shell)
|
|
105
105
|
- [fk-content-split](#fk-content-split)
|
|
106
106
|
|
|
107
|
-
### Docs — API-reference UI
|
|
108
|
-
|
|
109
|
-
- [fk-endpoint-link](#fk-endpoint-link)
|
|
110
|
-
- [fk-method-badge](#fk-method-badge)
|
|
111
|
-
|
|
112
107
|
---
|
|
113
108
|
|
|
114
109
|
## Core
|
|
@@ -663,21 +658,3 @@ Coordinates a single global "active key" with reference-counted holders, so unre
|
|
|
663
658
|
|
|
664
659
|
Global notification queue. Severity helpers (`success` / `error` / `warning` / `info`) for default toasts, plus `open()` for custom-component toasts with embedded actions like retry buttons.
|
|
665
660
|
[README](https://github.com/frame-kit/packages/blob/main/packages/ui-ng/services/toast/README.md)
|
|
666
|
-
|
|
667
|
-
---
|
|
668
|
-
|
|
669
|
-
## Docs
|
|
670
|
-
|
|
671
|
-
---
|
|
672
|
-
|
|
673
|
-
### fk-endpoint-link
|
|
674
|
-
|
|
675
|
-
A sidebar row for an API endpoint in developer documentation — pairs an HTTP method badge with the endpoint path.
|
|
676
|
-
[README](https://github.com/frame-kit/packages/blob/main/packages/ui-ng/docs/endpoint-link/README.md)
|
|
677
|
-
|
|
678
|
-
---
|
|
679
|
-
|
|
680
|
-
### fk-method-badge
|
|
681
|
-
|
|
682
|
-
A token-driven HTTP method badge for developer documentation — a colored GET/POST/PUT/DELETE pill.
|
|
683
|
-
[README](https://github.com/frame-kit/packages/blob/main/packages/ui-ng/docs/method-badge/README.md)
|
package/DEVELOPMENT_GUIDE.md
CHANGED
|
@@ -47,7 +47,6 @@ packages/ui-ng/
|
|
|
47
47
|
core/ — raw primitives, no other lib component deps (icon, text, headline, link, image, separator)
|
|
48
48
|
ui/ — composed reusable UI (button, dialog, drawer, toast, tabs, data-table, etc.)
|
|
49
49
|
directives/ — standalone behavior directives (tooltip, infinite-scroll, spotlight)
|
|
50
|
-
docs/ — API-reference UI (endpoint-link, method-badge)
|
|
51
50
|
forms/ — self-contained form system; packaged as ONE entry point (holds its own primitives)
|
|
52
51
|
engine/ — schema parser, field registry, validation, error messages, field state
|
|
53
52
|
fields/ — 16 form-field components (input, select, checkbox, etc.)
|
|
@@ -61,7 +60,7 @@ packages/ui-ng/
|
|
|
61
60
|
**Dependency rules:**
|
|
62
61
|
|
|
63
62
|
- `core` imports nothing from the lib.
|
|
64
|
-
- `ui
|
|
63
|
+
- `ui` and `directives` may use `core` and `services`.
|
|
65
64
|
- `forms` may use `core`, `ui`, `directives`, and `services`.
|
|
66
65
|
- `layouts` may use anything; nothing imports from `layouts`.
|
|
67
66
|
|
|
@@ -100,7 +99,7 @@ See [Public API Exports](#public-api-exports) for the files each new component m
|
|
|
100
99
|
|
|
101
100
|
## Folder and File Structure
|
|
102
101
|
|
|
103
|
-
Every component must have this exact file set, placed in the correct layer (`core/`, `ui/`, `directives/`, `
|
|
102
|
+
Every component must have this exact file set, placed in the correct layer (`core/`, `ui/`, `directives/`, `forms/{engine,fields,composition}/`, `layouts/`):
|
|
104
103
|
|
|
105
104
|
```
|
|
106
105
|
packages/ui-ng/<layer>/<name>/
|
|
@@ -970,7 +969,7 @@ There are two levels of barrel: the component's own entry-point `index.ts`, and
|
|
|
970
969
|
|
|
971
970
|
### Adding a new component to the public API
|
|
972
971
|
|
|
973
|
-
For a component in `core/ui/directives/
|
|
972
|
+
For a component in `core/ui/directives/layouts/services` (its own entry point):
|
|
974
973
|
|
|
975
974
|
1. **Write the entry-point `index.ts`** in the component folder, exporting its public files:
|
|
976
975
|
|
|
@@ -1036,7 +1035,7 @@ Before a component can be merged, every item must be checked:
|
|
|
1036
1035
|
|
|
1037
1036
|
### Structure
|
|
1038
1037
|
|
|
1039
|
-
- [ ] Placed in the correct layer (`core/`, `ui/`, `directives/`, `
|
|
1038
|
+
- [ ] Placed in the correct layer (`core/`, `ui/`, `directives/`, `forms/{engine,fields,composition}/`, or `layouts/`) following the dependency rules
|
|
1040
1039
|
- [ ] All required files present (`.ts`, `.html`, `.scss`, `.spec.ts`, `.stories.ts`, `.types.ts`, `README.md`)
|
|
1041
1040
|
- [ ] Entry-point files present (`index.ts` + `ng-package.json`) — for non-`forms` layers; `forms` components are added to the forms sub-barrels instead
|
|
1042
1041
|
- [ ] Cross-component imports use the `@frame-kit/ui-ng/<layer>/<name>` package path, never a relative `../` across an entry-point boundary
|
|
@@ -11,6 +11,8 @@ class CardComponent {
|
|
|
11
11
|
transparent = input(false, ...(ngDevMode ? [{ debugName: "transparent" }] : /* istanbul ignore next */ []));
|
|
12
12
|
/** When true, the card has no border or shadow. */
|
|
13
13
|
borderless = input(false, ...(ngDevMode ? [{ debugName: "borderless" }] : /* istanbul ignore next */ []));
|
|
14
|
+
/** When true, the card clips projected content to its rounded corners (`overflow: hidden`). Use for flush media or tables so their square corners don't poke past the card's radius. Opt-in, since it would also clip intentionally-overflowing content like menus or shadows. */
|
|
15
|
+
clip = input(false, ...(ngDevMode ? [{ debugName: "clip" }] : /* istanbul ignore next */ []));
|
|
14
16
|
// ===== BASE PROPS =====
|
|
15
17
|
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
16
18
|
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
@@ -25,6 +27,7 @@ class CardComponent {
|
|
|
25
27
|
`fk-card--align-${this.align()}`,
|
|
26
28
|
this.transparent() ? 'fk-card--transparent' : '',
|
|
27
29
|
this.borderless() ? 'fk-card--borderless' : '',
|
|
30
|
+
this.clip() ? 'fk-card--clip' : '',
|
|
28
31
|
this.className(),
|
|
29
32
|
]
|
|
30
33
|
.filter(Boolean)
|
|
@@ -43,12 +46,12 @@ class CardComponent {
|
|
|
43
46
|
return this.ariaLabel();
|
|
44
47
|
}
|
|
45
48
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
46
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: CardComponent, isStandalone: true, selector: "fk-card", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, transparent: { classPropertyName: "transparent", publicName: "transparent", isSignal: true, isRequired: false, transformFunction: null }, borderless: { classPropertyName: "borderless", publicName: "borderless", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass", "style.padding": "this.hostPadding", "attr.id": "this.hostId", "attr.aria-label": "this.hostAriaLabel" } }, ngImport: i0, template: "<ng-content />\n", styles: [":host{display:flex;flex-direction:column;background-color:var(--fk-card-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-card-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-card-border-radius, var(--fk-radius-lg, .75rem))}:host.fk-card--transparent{background-color:transparent}:host.fk-card--borderless{border-color:transparent}:host.fk-card--align-start{align-items:flex-start}:host.fk-card--align-center{align-items:center}:host.fk-card--align-end{align-items:flex-end}:host.fk-card--align-stretch{align-items:stretch}:host.fk-card--sm{padding:var(--fk-card-padding-sm, var(--fk-rhythm-4, 1rem))}:host.fk-card--md{padding:var(--fk-card-padding-md, var(--fk-rhythm-6, 1.5rem))}:host.fk-card--lg{padding:var(--fk-card-padding-lg, var(--fk-rhythm-8, 2rem))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
49
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: CardComponent, isStandalone: true, selector: "fk-card", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, transparent: { classPropertyName: "transparent", publicName: "transparent", isSignal: true, isRequired: false, transformFunction: null }, borderless: { classPropertyName: "borderless", publicName: "borderless", isSignal: true, isRequired: false, transformFunction: null }, clip: { classPropertyName: "clip", publicName: "clip", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass", "style.padding": "this.hostPadding", "attr.id": "this.hostId", "attr.aria-label": "this.hostAriaLabel" } }, ngImport: i0, template: "<ng-content />\n", styles: [":host{display:flex;flex-direction:column;background-color:var(--fk-card-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-card-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-card-border-radius, var(--fk-radius-lg, .75rem))}:host.fk-card--transparent{background-color:transparent}:host.fk-card--borderless{border-color:transparent}:host.fk-card--clip{overflow:hidden}:host.fk-card--align-start{align-items:flex-start}:host.fk-card--align-center{align-items:center}:host.fk-card--align-end{align-items:flex-end}:host.fk-card--align-stretch{align-items:stretch}:host.fk-card--sm{padding:var(--fk-card-padding-sm, var(--fk-rhythm-4, 1rem))}:host.fk-card--md{padding:var(--fk-card-padding-md, var(--fk-rhythm-6, 1.5rem))}:host.fk-card--lg{padding:var(--fk-card-padding-lg, var(--fk-rhythm-8, 2rem))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
50
|
}
|
|
48
51
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: CardComponent, decorators: [{
|
|
49
52
|
type: Component,
|
|
50
|
-
args: [{ selector: 'fk-card', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n", styles: [":host{display:flex;flex-direction:column;background-color:var(--fk-card-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-card-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-card-border-radius, var(--fk-radius-lg, .75rem))}:host.fk-card--transparent{background-color:transparent}:host.fk-card--borderless{border-color:transparent}:host.fk-card--align-start{align-items:flex-start}:host.fk-card--align-center{align-items:center}:host.fk-card--align-end{align-items:flex-end}:host.fk-card--align-stretch{align-items:stretch}:host.fk-card--sm{padding:var(--fk-card-padding-sm, var(--fk-rhythm-4, 1rem))}:host.fk-card--md{padding:var(--fk-card-padding-md, var(--fk-rhythm-6, 1.5rem))}:host.fk-card--lg{padding:var(--fk-card-padding-lg, var(--fk-rhythm-8, 2rem))}\n"] }]
|
|
51
|
-
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], transparent: [{ type: i0.Input, args: [{ isSignal: true, alias: "transparent", required: false }] }], borderless: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderless", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hostClass: [{
|
|
53
|
+
args: [{ selector: 'fk-card', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content />\n", styles: [":host{display:flex;flex-direction:column;background-color:var(--fk-card-bg, var(--fk-color-surface, #ffffff));border:1px solid var(--fk-card-border-color, var(--fk-color-border, #d9e2ee));border-radius:var(--fk-card-border-radius, var(--fk-radius-lg, .75rem))}:host.fk-card--transparent{background-color:transparent}:host.fk-card--borderless{border-color:transparent}:host.fk-card--clip{overflow:hidden}:host.fk-card--align-start{align-items:flex-start}:host.fk-card--align-center{align-items:center}:host.fk-card--align-end{align-items:flex-end}:host.fk-card--align-stretch{align-items:stretch}:host.fk-card--sm{padding:var(--fk-card-padding-sm, var(--fk-rhythm-4, 1rem))}:host.fk-card--md{padding:var(--fk-card-padding-md, var(--fk-rhythm-6, 1.5rem))}:host.fk-card--lg{padding:var(--fk-card-padding-lg, var(--fk-rhythm-8, 2rem))}\n"] }]
|
|
54
|
+
}], propDecorators: { size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], align: [{ type: i0.Input, args: [{ isSignal: true, alias: "align", required: false }] }], transparent: [{ type: i0.Input, args: [{ isSignal: true, alias: "transparent", required: false }] }], borderless: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderless", required: false }] }], clip: [{ type: i0.Input, args: [{ isSignal: true, alias: "clip", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hostClass: [{
|
|
52
55
|
type: HostBinding,
|
|
53
56
|
args: ['class']
|
|
54
57
|
}], hostPadding: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-kit-ui-ng-ui-card.mjs","sources":["../../../../packages/ui-ng/ui/card/card.component.ts","../../../../packages/ui-ng/ui/card/card.component.html","../../../../packages/ui-ng/ui/card/frame-kit-ui-ng-ui-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n} from '@angular/core';\n\nimport type { CardAlign, CardSize } from './card.types';\n\n@Component({\n selector: 'fk-card',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './card.component.html',\n styleUrl: './card.component.scss',\n})\nexport class CardComponent {\n // ===== INPUTS =====\n /** Preset size that controls the card's internal padding; also accepts any valid CSS padding string for a custom size. */\n readonly size = input<CardSize>('md');\n /** Alignment of the card's content along the cross axis. */\n readonly align = input<CardAlign>('stretch');\n /** When true, the card has no background fill. */\n readonly transparent = input<boolean>(false);\n /** When true, the card has no border or shadow. */\n readonly borderless = input<boolean>(false);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== COMPUTED =====\n private readonly sizePresets = ['sm', 'md', 'lg'];\n\n readonly isCustomSize = computed(\n () => !this.sizePresets.includes(this.size()),\n );\n\n readonly classes = computed(() => {\n return [\n 'fk-card',\n this.isCustomSize() ? '' : `fk-card--${this.size()}`,\n `fk-card--align-${this.align()}`,\n this.transparent() ? 'fk-card--transparent' : '',\n this.borderless() ? 'fk-card--borderless' : '',\n this.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('style.padding')\n get hostPadding(): string | null {\n return this.isCustomSize() ? this.size() : null;\n }\n\n @HostBinding('attr.id')\n get hostId() {\n return this.id();\n }\n\n @HostBinding('attr.aria-label')\n get hostAriaLabel() {\n return this.ariaLabel();\n }\n}\n","<ng-content />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkBa,aAAa,CAAA;;;AAGf,IAAA,IAAI,GAAG,KAAK,CAAW,IAAI,2EAAC;;AAE5B,IAAA,KAAK,GAAG,KAAK,CAAY,SAAS,4EAAC;;AAEnC,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,kFAAC;;AAEnC,IAAA,UAAU,GAAG,KAAK,CAAU,KAAK,iFAAC;;
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng-ui-card.mjs","sources":["../../../../packages/ui-ng/ui/card/card.component.ts","../../../../packages/ui-ng/ui/card/card.component.html","../../../../packages/ui-ng/ui/card/frame-kit-ui-ng-ui-card.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n} from '@angular/core';\n\nimport type { CardAlign, CardSize } from './card.types';\n\n@Component({\n selector: 'fk-card',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './card.component.html',\n styleUrl: './card.component.scss',\n})\nexport class CardComponent {\n // ===== INPUTS =====\n /** Preset size that controls the card's internal padding; also accepts any valid CSS padding string for a custom size. */\n readonly size = input<CardSize>('md');\n /** Alignment of the card's content along the cross axis. */\n readonly align = input<CardAlign>('stretch');\n /** When true, the card has no background fill. */\n readonly transparent = input<boolean>(false);\n /** When true, the card has no border or shadow. */\n readonly borderless = input<boolean>(false);\n /** When true, the card clips projected content to its rounded corners (`overflow: hidden`). Use for flush media or tables so their square corners don't poke past the card's radius. Opt-in, since it would also clip intentionally-overflowing content like menus or shadows. */\n readonly clip = input<boolean>(false);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== COMPUTED =====\n private readonly sizePresets = ['sm', 'md', 'lg'];\n\n readonly isCustomSize = computed(\n () => !this.sizePresets.includes(this.size()),\n );\n\n readonly classes = computed(() => {\n return [\n 'fk-card',\n this.isCustomSize() ? '' : `fk-card--${this.size()}`,\n `fk-card--align-${this.align()}`,\n this.transparent() ? 'fk-card--transparent' : '',\n this.borderless() ? 'fk-card--borderless' : '',\n this.clip() ? 'fk-card--clip' : '',\n this.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n @HostBinding('class')\n get hostClass() {\n return this.classes();\n }\n\n @HostBinding('style.padding')\n get hostPadding(): string | null {\n return this.isCustomSize() ? this.size() : null;\n }\n\n @HostBinding('attr.id')\n get hostId() {\n return this.id();\n }\n\n @HostBinding('attr.aria-label')\n get hostAriaLabel() {\n return this.ariaLabel();\n }\n}\n","<ng-content />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;MAkBa,aAAa,CAAA;;;AAGf,IAAA,IAAI,GAAG,KAAK,CAAW,IAAI,2EAAC;;AAE5B,IAAA,KAAK,GAAG,KAAK,CAAY,SAAS,4EAAC;;AAEnC,IAAA,WAAW,GAAG,KAAK,CAAU,KAAK,kFAAC;;AAEnC,IAAA,UAAU,GAAG,KAAK,CAAU,KAAK,iFAAC;;AAElC,IAAA,IAAI,GAAG,KAAK,CAAU,KAAK,2EAAC;;AAG5B,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;AAC7B,IAAA,EAAE,GAAG,KAAK,CAAgB,IAAI,yEAAC;AAC/B,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;;IAG9B,WAAW,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;AAExC,IAAA,YAAY,GAAG,QAAQ,CAC9B,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,mFAC9C;AAEQ,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QAC/B,OAAO;YACL,SAAS;AACT,YAAA,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE,GAAG,CAAA,SAAA,EAAY,IAAI,CAAC,IAAI,EAAE,CAAA,CAAE;AACpD,YAAA,CAAA,eAAA,EAAkB,IAAI,CAAC,KAAK,EAAE,CAAA,CAAE;YAChC,IAAI,CAAC,WAAW,EAAE,GAAG,sBAAsB,GAAG,EAAE;YAChD,IAAI,CAAC,UAAU,EAAE,GAAG,qBAAqB,GAAG,EAAE;YAC9C,IAAI,CAAC,IAAI,EAAE,GAAG,eAAe,GAAG,EAAE;YAClC,IAAI,CAAC,SAAS,EAAE;AACjB;aACE,MAAM,CAAC,OAAO;aACd,IAAI,CAAC,GAAG,CAAC;AACd,IAAA,CAAC,8EAAC;AAEF,IAAA,IACI,SAAS,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;AAEA,IAAA,IACI,WAAW,GAAA;AACb,QAAA,OAAO,IAAI,CAAC,YAAY,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI;IACjD;AAEA,IAAA,IACI,MAAM,GAAA;AACR,QAAA,OAAO,IAAI,CAAC,EAAE,EAAE;IAClB;AAEA,IAAA,IACI,aAAa,GAAA;AACf,QAAA,OAAO,IAAI,CAAC,SAAS,EAAE;IACzB;uGAzDW,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAb,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,aAAa,stCClB1B,kBACA,EAAA,MAAA,EAAA,CAAA,m0BAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDiBa,aAAa,EAAA,UAAA,EAAA,CAAA;kBARzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,SAAS,cACP,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,eAAA,EACM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,CAAA,m0BAAA,CAAA,EAAA;;sBA2C9C,WAAW;uBAAC,OAAO;;sBAKnB,WAAW;uBAAC,eAAe;;sBAK3B,WAAW;uBAAC,SAAS;;sBAKrB,WAAW;uBAAC,iBAAiB;;;AExEhC;;AAEG;;;;"}
|
|
@@ -7,8 +7,6 @@ export * from '@frame-kit/ui-ng/core/text';
|
|
|
7
7
|
export * from '@frame-kit/ui-ng/directives/infinite-scroll';
|
|
8
8
|
export * from '@frame-kit/ui-ng/directives/spotlight';
|
|
9
9
|
export * from '@frame-kit/ui-ng/directives/tooltip';
|
|
10
|
-
export * from '@frame-kit/ui-ng/docs/endpoint-link';
|
|
11
|
-
export * from '@frame-kit/ui-ng/docs/method-badge';
|
|
12
10
|
export * from '@frame-kit/ui-ng/forms';
|
|
13
11
|
export * from '@frame-kit/ui-ng/layouts/app-shell';
|
|
14
12
|
export * from '@frame-kit/ui-ng/layouts/content-split';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frame-kit-ui-ng.mjs","sources":["../../../../packages/ui-ng/frame-kit-ui-ng.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"frame-kit-ui-ng.mjs","sources":["../../../../packages/ui-ng/frame-kit-ui-ng.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frame-kit/ui-ng",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Style-agnostic, token-driven Angular UI component library for FrameKit.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -69,14 +69,6 @@
|
|
|
69
69
|
"types": "./types/frame-kit-ui-ng-directives-tooltip.d.ts",
|
|
70
70
|
"default": "./fesm2022/frame-kit-ui-ng-directives-tooltip.mjs"
|
|
71
71
|
},
|
|
72
|
-
"./docs/endpoint-link": {
|
|
73
|
-
"types": "./types/frame-kit-ui-ng-docs-endpoint-link.d.ts",
|
|
74
|
-
"default": "./fesm2022/frame-kit-ui-ng-docs-endpoint-link.mjs"
|
|
75
|
-
},
|
|
76
|
-
"./docs/method-badge": {
|
|
77
|
-
"types": "./types/frame-kit-ui-ng-docs-method-badge.d.ts",
|
|
78
|
-
"default": "./fesm2022/frame-kit-ui-ng-docs-method-badge.mjs"
|
|
79
|
-
},
|
|
80
72
|
"./forms": {
|
|
81
73
|
"types": "./types/frame-kit-ui-ng-forms.d.ts",
|
|
82
74
|
"default": "./fesm2022/frame-kit-ui-ng-forms.mjs"
|
|
@@ -250,4 +242,4 @@
|
|
|
250
242
|
"dependencies": {
|
|
251
243
|
"tslib": "^2.3.0"
|
|
252
244
|
}
|
|
253
|
-
}
|
|
245
|
+
}
|
|
@@ -12,6 +12,8 @@ declare class CardComponent {
|
|
|
12
12
|
readonly transparent: _angular_core.InputSignal<boolean>;
|
|
13
13
|
/** When true, the card has no border or shadow. */
|
|
14
14
|
readonly borderless: _angular_core.InputSignal<boolean>;
|
|
15
|
+
/** When true, the card clips projected content to its rounded corners (`overflow: hidden`). Use for flush media or tables so their square corners don't poke past the card's radius. Opt-in, since it would also clip intentionally-overflowing content like menus or shadows. */
|
|
16
|
+
readonly clip: _angular_core.InputSignal<boolean>;
|
|
15
17
|
readonly className: _angular_core.InputSignal<string>;
|
|
16
18
|
readonly id: _angular_core.InputSignal<string | null>;
|
|
17
19
|
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
@@ -23,7 +25,7 @@ declare class CardComponent {
|
|
|
23
25
|
get hostId(): string | null;
|
|
24
26
|
get hostAriaLabel(): string | null;
|
|
25
27
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CardComponent, never>;
|
|
26
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "fk-card", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "transparent": { "alias": "transparent"; "required": false; "isSignal": true; }; "borderless": { "alias": "borderless"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
28
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CardComponent, "fk-card", never, { "size": { "alias": "size"; "required": false; "isSignal": true; }; "align": { "alias": "align"; "required": false; "isSignal": true; }; "transparent": { "alias": "transparent"; "required": false; "isSignal": true; }; "borderless": { "alias": "borderless"; "required": false; "isSignal": true; }; "clip": { "alias": "clip"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export { CardComponent };
|
|
@@ -7,8 +7,6 @@ export * from '@frame-kit/ui-ng/core/text';
|
|
|
7
7
|
export * from '@frame-kit/ui-ng/directives/infinite-scroll';
|
|
8
8
|
export * from '@frame-kit/ui-ng/directives/spotlight';
|
|
9
9
|
export * from '@frame-kit/ui-ng/directives/tooltip';
|
|
10
|
-
export * from '@frame-kit/ui-ng/docs/endpoint-link';
|
|
11
|
-
export * from '@frame-kit/ui-ng/docs/method-badge';
|
|
12
10
|
export * from '@frame-kit/ui-ng/forms';
|
|
13
11
|
export * from '@frame-kit/ui-ng/layouts/app-shell';
|
|
14
12
|
export * from '@frame-kit/ui-ng/layouts/content-split';
|
package/ui/card/README.md
CHANGED
|
@@ -8,13 +8,16 @@ A token-driven container component for grouping related content with consistent
|
|
|
8
8
|
|
|
9
9
|
### Inputs
|
|
10
10
|
|
|
11
|
-
| Input
|
|
12
|
-
|
|
|
13
|
-
| `size`
|
|
14
|
-
| `align`
|
|
15
|
-
| `
|
|
16
|
-
| `
|
|
17
|
-
| `
|
|
11
|
+
| Input | Type | Default | Description |
|
|
12
|
+
| ------------- | ------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------ |
|
|
13
|
+
| `size` | `'sm' \| 'md' \| 'lg' \| string` | `'md'` | Padding preset or custom CSS value (e.g. `'3rem'`) |
|
|
14
|
+
| `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | `'stretch'` | Cross-axis alignment of projected content |
|
|
15
|
+
| `transparent` | `boolean` | `false` | Removes the background fill — for a card used purely as a layout primitive |
|
|
16
|
+
| `borderless` | `boolean` | `false` | Removes the border — pair with `transparent` for a fully chromeless container |
|
|
17
|
+
| `clip` | `boolean` | `false` | Clips projected content to the rounded corners (`overflow: hidden`). Use for flush media or tables so their square corners don't poke past the radius |
|
|
18
|
+
| `className` | `string` | `''` | Additional CSS classes for the host element |
|
|
19
|
+
| `id` | `string \| null` | `null` | Sets the `id` attribute on the host element |
|
|
20
|
+
| `ariaLabel` | `string \| null` | `null` | Sets `aria-label` on the host element for assistive technology |
|
|
18
21
|
|
|
19
22
|
### Outputs
|
|
20
23
|
|
|
@@ -121,6 +124,22 @@ export class ExampleComponent {}
|
|
|
121
124
|
</fk-card>
|
|
122
125
|
```
|
|
123
126
|
|
|
127
|
+
### Flush media or table (clipped to the radius)
|
|
128
|
+
|
|
129
|
+
When projecting full-bleed content — an image, or a component that brings its
|
|
130
|
+
own background like `fk-data-table` — set `size="0"` to drop the padding and
|
|
131
|
+
`clip` so the content's square corners are clipped to the card's rounded
|
|
132
|
+
border:
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<fk-card size="0" [clip]="true">
|
|
136
|
+
<img src="cover.jpg" alt="" style="width: 100%; display: block;" />
|
|
137
|
+
</fk-card>
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Without `clip`, the card has a `border-radius` but no overflow management, so
|
|
141
|
+
the flush content renders square corners that poke past the rounded border.
|
|
142
|
+
|
|
124
143
|
---
|
|
125
144
|
|
|
126
145
|
## Accessibility
|
|
@@ -172,3 +191,4 @@ Or scope overrides to a specific context:
|
|
|
172
191
|
- When `size` is a preset (`sm`, `md`, `lg`), padding is controlled via the corresponding token. When `size` is a custom string, it is applied directly as inline `padding`.
|
|
173
192
|
- The card renders as a flex column container, so projected content flows vertically by default.
|
|
174
193
|
- `align` controls `align-items` on the flex container, affecting horizontal alignment of children.
|
|
194
|
+
- `clip` is opt-in rather than always-on because `overflow: hidden` would also clip content that is _meant_ to overflow — dropdown menus, tooltips, or popovers anchored inside the card. Enable it only for flush media/table layouts.
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
# fk-endpoint-link
|
|
2
|
-
|
|
3
|
-
A sidebar row for an API endpoint in developer documentation. Combines an
|
|
4
|
-
`fk-method-badge` with a label inside a single clickable router link, and
|
|
5
|
-
tracks active state from the current URL.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## API
|
|
10
|
-
|
|
11
|
-
### Inputs
|
|
12
|
-
|
|
13
|
-
| Input | Type | Default | Description |
|
|
14
|
-
| ------------ | -------------------- | ------------ | ------------------------------------------------------- |
|
|
15
|
-
| `method` | `EndpointLinkMethod` | **required** | HTTP method shown in the badge |
|
|
16
|
-
| `label` | `string` | **required** | Endpoint description (e.g. operation summary) |
|
|
17
|
-
| `routerLink` | `string \| any[]` | **required** | Target route — passed through to Angular's `routerLink` |
|
|
18
|
-
| `exact` | `boolean` | `false` | Require exact URL match to apply the active state |
|
|
19
|
-
| `className` | `string` | `""` | Additional CSS classes merged onto the host element |
|
|
20
|
-
|
|
21
|
-
### Outputs
|
|
22
|
-
|
|
23
|
-
None.
|
|
24
|
-
|
|
25
|
-
### Content
|
|
26
|
-
|
|
27
|
-
`fk-endpoint-link` does not project content.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Features
|
|
32
|
-
|
|
33
|
-
- Active state tracked from `Router.url` via `NavigationEnd` (avoids known
|
|
34
|
-
`routerLinkActive` quirks with signal-based `[routerLink]` inputs)
|
|
35
|
-
- Prefix-matching by default so sub-paths still highlight; opt into exact
|
|
36
|
-
matching with `exact`
|
|
37
|
-
- Uses `fk-method-badge` so method colors and tokens stay consistent
|
|
38
|
-
- Ellipsis-truncated label keeps dense nav columns clean
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Quick Start
|
|
43
|
-
|
|
44
|
-
```html
|
|
45
|
-
<fk-endpoint-link method="get" label="List users" [routerLink]="['/docs/api-reference', 'List_users']" />
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
---
|
|
49
|
-
|
|
50
|
-
## Import
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
import { EndpointLinkComponent } from '@frame-kit/ui-ng';
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
```ts
|
|
57
|
-
@Component({
|
|
58
|
-
selector: 'app-example',
|
|
59
|
-
imports: [EndpointLinkComponent],
|
|
60
|
-
templateUrl: './example.component.html',
|
|
61
|
-
})
|
|
62
|
-
export class ExampleComponent {}
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Selector
|
|
68
|
-
|
|
69
|
-
```html
|
|
70
|
-
<fk-endpoint-link method="get" label="..." [routerLink]="[...]" />
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Examples
|
|
76
|
-
|
|
77
|
-
### Verbs across methods
|
|
78
|
-
|
|
79
|
-
```html
|
|
80
|
-
<fk-endpoint-link method="get" label="List widgets" [routerLink]="['/list']" />
|
|
81
|
-
<fk-endpoint-link method="post" label="Create widget" [routerLink]="['/create']" />
|
|
82
|
-
<fk-endpoint-link method="delete" label="Delete widget" [routerLink]="['/delete']" />
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### Exact URL matching
|
|
86
|
-
|
|
87
|
-
```html
|
|
88
|
-
<fk-endpoint-link method="get" label="Overview" [routerLink]="['/docs/api-reference']" [exact]="true" />
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Accessibility
|
|
94
|
-
|
|
95
|
-
- Renders as a semantic `<a>` element with a real `routerLink` target —
|
|
96
|
-
keyboard navigation works with Tab + Enter
|
|
97
|
-
- Focus ring uses `--fk-focus-ring` tokens
|
|
98
|
-
- Active state is communicated visually via color and font weight; the route
|
|
99
|
-
itself is the authoritative signal for assistive technology
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Design Tokens
|
|
104
|
-
|
|
105
|
-
```scss
|
|
106
|
-
--fk-endpoint-link-gap;
|
|
107
|
-
--fk-endpoint-link-padding-block;
|
|
108
|
-
--fk-endpoint-link-padding-inline;
|
|
109
|
-
--fk-endpoint-link-radius;
|
|
110
|
-
--fk-endpoint-link-font-size;
|
|
111
|
-
--fk-endpoint-link-color;
|
|
112
|
-
--fk-endpoint-link-bg-hover;
|
|
113
|
-
--fk-endpoint-link-bg-active;
|
|
114
|
-
--fk-endpoint-link-color-active;
|
|
115
|
-
--fk-endpoint-link-font-weight-active;
|
|
116
|
-
--fk-endpoint-link-focus-ring;
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
Override in your app stylesheet:
|
|
120
|
-
|
|
121
|
-
```scss
|
|
122
|
-
:root {
|
|
123
|
-
--fk-endpoint-link-bg-active: #dbeafe;
|
|
124
|
-
--fk-endpoint-link-color-active: #1e3a8a;
|
|
125
|
-
}
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Behavior Notes
|
|
131
|
-
|
|
132
|
-
- Active detection compares the current URL (after redirects) against the
|
|
133
|
-
target derived from `routerLink`. String and array forms are both
|
|
134
|
-
supported
|
|
135
|
-
- Clicks call `stopPropagation` so the link doesn't re-trigger click
|
|
136
|
-
handlers on wrapping rows (useful when nested inside expandable groups)
|
|
137
|
-
- When rendered inside an `fk-app-shell`, clicks also call
|
|
138
|
-
`dismissSidenav()` on the ancestor shell. On mobile, this closes the
|
|
139
|
-
sidenav overlay so the user lands on the endpoint content; on desktop
|
|
140
|
-
it's a no-op because `dismissSidenav` only affects the mobile temporary
|
|
141
|
-
state. The ancestor shell is optional — the link works standalone too
|
|
142
|
-
- The label is truncated with ellipsis when it exceeds the available width
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
# fk-method-badge
|
|
2
|
-
|
|
3
|
-
A token-driven HTTP method badge for developer documentation. Renders a
|
|
4
|
-
compact, colored label (`GET`, `POST`, `PUT`, etc.) so readers can scan an
|
|
5
|
-
endpoint list and identify verbs at a glance.
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## API
|
|
10
|
-
|
|
11
|
-
### Inputs
|
|
12
|
-
|
|
13
|
-
| Input | Type | Default | Description |
|
|
14
|
-
| ----------- | ------------------- | ------------ | --------------------------------------------------- |
|
|
15
|
-
| `method` | `MethodBadgeMethod` | **required** | HTTP method (lowercase to match OpenAPI) |
|
|
16
|
-
| `className` | `string` | `""` | Additional CSS classes merged onto the host element |
|
|
17
|
-
| `id` | `string \| null` | `null` | Optional ID applied to the inner label span |
|
|
18
|
-
| `ariaLabel` | `string \| null` | `null` | Accessible label for the badge |
|
|
19
|
-
|
|
20
|
-
### Outputs
|
|
21
|
-
|
|
22
|
-
None.
|
|
23
|
-
|
|
24
|
-
### Content
|
|
25
|
-
|
|
26
|
-
`fk-method-badge` does not project content — the label is derived from
|
|
27
|
-
`method` and rendered in uppercase.
|
|
28
|
-
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
## Features
|
|
32
|
-
|
|
33
|
-
- Per-method pastel color palette baked in as fallbacks
|
|
34
|
-
- Token-driven background and text colors with dark-mode overrides
|
|
35
|
-
- Monospace label for consistent width across methods
|
|
36
|
-
- Works standalone or inside other components (e.g. `fk-endpoint-link`)
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
|
|
40
|
-
## Quick Start
|
|
41
|
-
|
|
42
|
-
```html
|
|
43
|
-
<fk-method-badge method="get" />
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
```html
|
|
47
|
-
<fk-method-badge method="post" />
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## Import
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
import { MethodBadgeComponent } from '@frame-kit/ui-ng';
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
@Component({
|
|
60
|
-
selector: 'app-example',
|
|
61
|
-
imports: [MethodBadgeComponent],
|
|
62
|
-
templateUrl: './example.component.html',
|
|
63
|
-
})
|
|
64
|
-
export class ExampleComponent {}
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Selector
|
|
70
|
-
|
|
71
|
-
```html
|
|
72
|
-
<fk-method-badge method="get" />
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Examples
|
|
78
|
-
|
|
79
|
-
### All supported methods
|
|
80
|
-
|
|
81
|
-
```html
|
|
82
|
-
<fk-method-badge method="get" />
|
|
83
|
-
<fk-method-badge method="post" />
|
|
84
|
-
<fk-method-badge method="put" />
|
|
85
|
-
<fk-method-badge method="patch" />
|
|
86
|
-
<fk-method-badge method="delete" />
|
|
87
|
-
<fk-method-badge method="head" />
|
|
88
|
-
<fk-method-badge method="options" />
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Inside an endpoint list
|
|
92
|
-
|
|
93
|
-
```html
|
|
94
|
-
<fk-endpoint-link method="get" label="List users" [routerLink]="['/docs/api-reference', 'List_users']" />
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## Accessibility
|
|
100
|
-
|
|
101
|
-
- Renders as an inline span element inside the host
|
|
102
|
-
- Set `ariaLabel` for screen readers when the verb alone is not enough
|
|
103
|
-
context (e.g. `ariaLabel="HTTP GET"`)
|
|
104
|
-
- Color alone does not convey meaning — the verb is always present as text
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
## Design Tokens
|
|
109
|
-
|
|
110
|
-
```scss
|
|
111
|
-
--fk-method-badge-min-width;
|
|
112
|
-
--fk-method-badge-padding-block;
|
|
113
|
-
--fk-method-badge-padding-inline;
|
|
114
|
-
--fk-method-badge-radius;
|
|
115
|
-
--fk-method-badge-font-size;
|
|
116
|
-
--fk-method-badge-font-weight;
|
|
117
|
-
--fk-method-badge-color;
|
|
118
|
-
|
|
119
|
-
--fk-method-badge-bg-neutral;
|
|
120
|
-
--fk-method-badge-bg-get;
|
|
121
|
-
--fk-method-badge-bg-post;
|
|
122
|
-
--fk-method-badge-bg-put;
|
|
123
|
-
--fk-method-badge-bg-patch;
|
|
124
|
-
--fk-method-badge-bg-delete;
|
|
125
|
-
--fk-method-badge-bg-head;
|
|
126
|
-
--fk-method-badge-bg-options;
|
|
127
|
-
|
|
128
|
-
--fk-method-badge-color-get;
|
|
129
|
-
--fk-method-badge-color-post;
|
|
130
|
-
--fk-method-badge-color-put;
|
|
131
|
-
--fk-method-badge-color-patch;
|
|
132
|
-
--fk-method-badge-color-delete;
|
|
133
|
-
--fk-method-badge-color-head;
|
|
134
|
-
--fk-method-badge-color-options;
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Override in your app stylesheet:
|
|
138
|
-
|
|
139
|
-
```scss
|
|
140
|
-
:root {
|
|
141
|
-
--fk-method-badge-radius: 9999px;
|
|
142
|
-
--fk-method-badge-bg-get: #a7f3d0;
|
|
143
|
-
}
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
## Behavior Notes
|
|
149
|
-
|
|
150
|
-
- Method names are lowercase on input to match OpenAPI conventions; the
|
|
151
|
-
rendered label is automatically uppercased
|
|
152
|
-
- `head` and `options` fall back to the neutral background by default
|
|
153
|
-
- Typography is locked to a monospace stack so labels align vertically in
|
|
154
|
-
dense lists
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, input, computed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { RouterLink, RouterLinkActive } from '@angular/router';
|
|
4
|
-
import { AppShellComponent } from '@frame-kit/ui-ng/layouts/app-shell';
|
|
5
|
-
import { MethodBadgeComponent } from '@frame-kit/ui-ng/docs/method-badge';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Sidebar/list item for an API endpoint in developer documentation.
|
|
9
|
-
*
|
|
10
|
-
* Renders a leading `fk-method-badge` followed by the endpoint label as a
|
|
11
|
-
* single clickable router link. Used to list operations (e.g. "GET List
|
|
12
|
-
* permissions", "POST Create identity") in a documentation sidebar or any
|
|
13
|
-
* denser endpoint index.
|
|
14
|
-
*
|
|
15
|
-
* Active state is driven by `routerLinkActive`, matching the behavior of
|
|
16
|
-
* `fk-sidenav-link` so every router-aware nav item in the library resolves
|
|
17
|
-
* active state the same way.
|
|
18
|
-
*
|
|
19
|
-
* When rendered inside an `fk-app-shell`, clicks also call `dismissSidenav`
|
|
20
|
-
* on the ancestor shell — this closes the mobile overlay so the user lands
|
|
21
|
-
* directly on the selected endpoint. On desktop it's a no-op.
|
|
22
|
-
*/
|
|
23
|
-
class EndpointLinkComponent {
|
|
24
|
-
shell = inject(AppShellComponent, { optional: true });
|
|
25
|
-
// ===== INPUTS =====
|
|
26
|
-
method = input.required(...(ngDevMode ? [{ debugName: "method" }] : /* istanbul ignore next */ []));
|
|
27
|
-
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
28
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
routerLink = input.required(...(ngDevMode ? [{ debugName: "routerLink" }] : /* istanbul ignore next */ []));
|
|
30
|
-
/**
|
|
31
|
-
* Whether to require an exact URL match for the active state. Defaults to
|
|
32
|
-
* false — each endpoint has a unique final path segment so prefix matching
|
|
33
|
-
* resolves to the same thing in practice.
|
|
34
|
-
*/
|
|
35
|
-
exact = input(false, ...(ngDevMode ? [{ debugName: "exact" }] : /* istanbul ignore next */ []));
|
|
36
|
-
// ===== BASE PROPS =====
|
|
37
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
38
|
-
// ===== COMPUTED =====
|
|
39
|
-
classes = computed(() => ['fk-endpoint-link', this.className()].filter(Boolean).join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
40
|
-
activeOptions = computed(() => ({ exact: this.exact() }), ...(ngDevMode ? [{ debugName: "activeOptions" }] : /* istanbul ignore next */ []));
|
|
41
|
-
get hostClass() {
|
|
42
|
-
return this.classes();
|
|
43
|
-
}
|
|
44
|
-
dismiss() {
|
|
45
|
-
this.shell?.dismissSidenav();
|
|
46
|
-
}
|
|
47
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EndpointLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: EndpointLinkComponent, isStandalone: true, selector: "fk-endpoint-link", inputs: { method: { classPropertyName: "method", publicName: "method", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: true, transformFunction: null }, routerLink: { classPropertyName: "routerLink", publicName: "routerLink", isSignal: true, isRequired: true, transformFunction: null }, exact: { classPropertyName: "exact", publicName: "exact", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<a\n class=\"fk-endpoint-link__anchor\"\n [routerLink]=\"routerLink()\"\n routerLinkActive=\"fk-endpoint-link__anchor--active\"\n [routerLinkActiveOptions]=\"activeOptions()\"\n (click)=\"$event.stopPropagation(); dismiss()\"\n>\n <fk-method-badge [method]=\"method()\" class=\"fk-endpoint-link__badge\" />\n <span class=\"fk-endpoint-link__label\">{{ label() }}</span>\n</a>\n", styles: [".fk-endpoint-link{display:block}.fk-endpoint-link__anchor{display:flex;align-items:center;gap:var(--fk-endpoint-link-gap, var(--fk-rhythm-2, .5rem));padding:var(--fk-endpoint-link-padding-block, var(--fk-rhythm-1, .25rem)) var(--fk-endpoint-link-padding-inline, var(--fk-rhythm-3, .75rem));border-radius:var(--fk-endpoint-link-radius, var(--fk-radius-md, .5rem));color:var(--fk-endpoint-link-color, var(--fk-color-text, #1f2d3d));font-size:var(--fk-endpoint-link-font-size, .875rem);line-height:1.4;text-decoration:none;transition:background-color .15s ease}.fk-endpoint-link__anchor:hover{background-color:var(--fk-endpoint-link-bg-hover, var(--fk-color-surface-muted, #f7f9fb))}.fk-endpoint-link__anchor:focus-visible{outline:none;box-shadow:var(--fk-endpoint-link-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-endpoint-link__anchor--active,.fk-endpoint-link__anchor--active:hover{background-color:var(--fk-endpoint-link-bg-active, var(--fk-color-primary-light, #dbeafe));color:var(--fk-endpoint-link-color-active, var(--fk-color-primary, #1e3a8a));font-weight:var(--fk-endpoint-link-font-weight-active, var(--fk-font-weight-semibold, 600))}.fk-endpoint-link__badge{flex-shrink:0}.fk-endpoint-link__label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"], dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: RouterLinkActive, selector: "[routerLinkActive]", inputs: ["routerLinkActiveOptions", "ariaCurrentWhenActive", "routerLinkActive"], outputs: ["isActiveChange"], exportAs: ["routerLinkActive"] }, { kind: "component", type: MethodBadgeComponent, selector: "fk-method-badge", inputs: ["method", "className", "id", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
49
|
-
}
|
|
50
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: EndpointLinkComponent, decorators: [{
|
|
51
|
-
type: Component,
|
|
52
|
-
args: [{ selector: 'fk-endpoint-link', standalone: true, imports: [RouterLink, RouterLinkActive, MethodBadgeComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n class=\"fk-endpoint-link__anchor\"\n [routerLink]=\"routerLink()\"\n routerLinkActive=\"fk-endpoint-link__anchor--active\"\n [routerLinkActiveOptions]=\"activeOptions()\"\n (click)=\"$event.stopPropagation(); dismiss()\"\n>\n <fk-method-badge [method]=\"method()\" class=\"fk-endpoint-link__badge\" />\n <span class=\"fk-endpoint-link__label\">{{ label() }}</span>\n</a>\n", styles: [".fk-endpoint-link{display:block}.fk-endpoint-link__anchor{display:flex;align-items:center;gap:var(--fk-endpoint-link-gap, var(--fk-rhythm-2, .5rem));padding:var(--fk-endpoint-link-padding-block, var(--fk-rhythm-1, .25rem)) var(--fk-endpoint-link-padding-inline, var(--fk-rhythm-3, .75rem));border-radius:var(--fk-endpoint-link-radius, var(--fk-radius-md, .5rem));color:var(--fk-endpoint-link-color, var(--fk-color-text, #1f2d3d));font-size:var(--fk-endpoint-link-font-size, .875rem);line-height:1.4;text-decoration:none;transition:background-color .15s ease}.fk-endpoint-link__anchor:hover{background-color:var(--fk-endpoint-link-bg-hover, var(--fk-color-surface-muted, #f7f9fb))}.fk-endpoint-link__anchor:focus-visible{outline:none;box-shadow:var(--fk-endpoint-link-focus-ring, var(--fk-focus-ring, 0 0 0 3px rgba(10, 132, 255, .18)))}.fk-endpoint-link__anchor--active,.fk-endpoint-link__anchor--active:hover{background-color:var(--fk-endpoint-link-bg-active, var(--fk-color-primary-light, #dbeafe));color:var(--fk-endpoint-link-color-active, var(--fk-color-primary, #1e3a8a));font-weight:var(--fk-endpoint-link-font-weight-active, var(--fk-font-weight-semibold, 600))}.fk-endpoint-link__badge{flex-shrink:0}.fk-endpoint-link__label{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}\n"] }]
|
|
53
|
-
}], propDecorators: { method: [{ type: i0.Input, args: [{ isSignal: true, alias: "method", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: true }] }], routerLink: [{ type: i0.Input, args: [{ isSignal: true, alias: "routerLink", required: true }] }], exact: [{ type: i0.Input, args: [{ isSignal: true, alias: "exact", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], hostClass: [{
|
|
54
|
-
type: HostBinding,
|
|
55
|
-
args: ['class']
|
|
56
|
-
}] } });
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Generated bundle index. Do not edit.
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
export { EndpointLinkComponent };
|
|
63
|
-
//# sourceMappingURL=frame-kit-ui-ng-docs-endpoint-link.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame-kit-ui-ng-docs-endpoint-link.mjs","sources":["../../../../packages/ui-ng/docs/endpoint-link/endpoint-link.component.ts","../../../../packages/ui-ng/docs/endpoint-link/endpoint-link.component.html","../../../../packages/ui-ng/docs/endpoint-link/frame-kit-ui-ng-docs-endpoint-link.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n inject,\n input,\n} from '@angular/core';\nimport { RouterLink, RouterLinkActive } from '@angular/router';\n\nimport { AppShellComponent } from '@frame-kit/ui-ng/layouts/app-shell';\nimport { MethodBadgeComponent } from '@frame-kit/ui-ng/docs/method-badge';\nimport type { MethodBadgeMethod } from '@frame-kit/ui-ng/docs/method-badge';\n\n/**\n * Sidebar/list item for an API endpoint in developer documentation.\n *\n * Renders a leading `fk-method-badge` followed by the endpoint label as a\n * single clickable router link. Used to list operations (e.g. \"GET List\n * permissions\", \"POST Create identity\") in a documentation sidebar or any\n * denser endpoint index.\n *\n * Active state is driven by `routerLinkActive`, matching the behavior of\n * `fk-sidenav-link` so every router-aware nav item in the library resolves\n * active state the same way.\n *\n * When rendered inside an `fk-app-shell`, clicks also call `dismissSidenav`\n * on the ancestor shell — this closes the mobile overlay so the user lands\n * directly on the selected endpoint. On desktop it's a no-op.\n */\n@Component({\n selector: 'fk-endpoint-link',\n standalone: true,\n imports: [RouterLink, RouterLinkActive, MethodBadgeComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './endpoint-link.component.html',\n styleUrl: './endpoint-link.component.scss',\n})\nexport class EndpointLinkComponent {\n private readonly shell = inject(AppShellComponent, { optional: true });\n\n // ===== INPUTS =====\n readonly method = input.required<MethodBadgeMethod>();\n readonly label = input.required<string>();\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n readonly routerLink = input.required<string | any[]>();\n\n /**\n * Whether to require an exact URL match for the active state. Defaults to\n * false — each endpoint has a unique final path segment so prefix matching\n * resolves to the same thing in practice.\n */\n readonly exact = input<boolean>(false);\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n\n // ===== COMPUTED =====\n readonly classes = computed(() =>\n ['fk-endpoint-link', this.className()].filter(Boolean).join(' '),\n );\n\n readonly activeOptions = computed(() => ({ exact: this.exact() }));\n\n @HostBinding('class')\n get hostClass(): string {\n return this.classes();\n }\n\n protected dismiss(): void {\n this.shell?.dismissSidenav();\n }\n}\n","<a\n class=\"fk-endpoint-link__anchor\"\n [routerLink]=\"routerLink()\"\n routerLinkActive=\"fk-endpoint-link__anchor--active\"\n [routerLinkActiveOptions]=\"activeOptions()\"\n (click)=\"$event.stopPropagation(); dismiss()\"\n>\n <fk-method-badge [method]=\"method()\" class=\"fk-endpoint-link__badge\" />\n <span class=\"fk-endpoint-link__label\">{{ label() }}</span>\n</a>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAcA;;;;;;;;;;;;;;;AAeG;MASU,qBAAqB,CAAA;IACf,KAAK,GAAG,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;AAG7D,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAqB;AAC5C,IAAA,KAAK,GAAG,KAAK,CAAC,QAAQ,2EAAU;;AAGhC,IAAA,UAAU,GAAG,KAAK,CAAC,QAAQ,gFAAkB;AAEtD;;;;AAIG;AACM,IAAA,KAAK,GAAG,KAAK,CAAU,KAAK,4EAAC;;AAG7B,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;;IAG7B,OAAO,GAAG,QAAQ,CAAC,MAC1B,CAAC,kBAAkB,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CACjE;AAEQ,IAAA,aAAa,GAAG,QAAQ,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,oFAAC;AAElE,IAAA,IACI,SAAS,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;IAEU,OAAO,GAAA;AACf,QAAA,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE;IAC9B;uGAlCW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAArB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,qBAAqB,gwBCtClC,kYAUA,EAAA,MAAA,EAAA,CAAA,myCAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EDuBY,UAAU,EAAA,QAAA,EAAA,cAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,aAAA,EAAA,UAAA,EAAA,qBAAA,EAAA,OAAA,EAAA,MAAA,EAAA,YAAA,EAAA,kBAAA,EAAA,oBAAA,EAAA,YAAA,EAAA,YAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAE,gBAAgB,8MAAE,oBAAoB,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,CAAA,QAAA,EAAA,WAAA,EAAA,IAAA,EAAA,WAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKjD,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBARjC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,OAAA,EACP,CAAC,UAAU,EAAE,gBAAgB,EAAE,oBAAoB,CAAC,EAAA,eAAA,EAC5C,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,kYAAA,EAAA,MAAA,EAAA,CAAA,myCAAA,CAAA,EAAA;;sBA+B9C,WAAW;uBAAC,OAAO;;;AEjEtB;;AAEG;;;;"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, computed, HostBinding, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Small rectangular badge showing an HTTP method label (e.g. `GET`, `POST`).
|
|
6
|
-
*
|
|
7
|
-
* Each method has its own hue so consumers can identify the verb in a dense
|
|
8
|
-
* list. Background colors are exposed as CSS variables
|
|
9
|
-
* (`--fk-method-badge-bg-get`, etc.) with defaults baked in so the component
|
|
10
|
-
* renders correctly without a theme.
|
|
11
|
-
*/
|
|
12
|
-
class MethodBadgeComponent {
|
|
13
|
-
// ===== INPUTS =====
|
|
14
|
-
method = input.required(...(ngDevMode ? [{ debugName: "method" }] : /* istanbul ignore next */ []));
|
|
15
|
-
// ===== BASE PROPS =====
|
|
16
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
17
|
-
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
18
|
-
ariaLabel = input(null, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
19
|
-
// ===== COMPUTED =====
|
|
20
|
-
classes = computed(() => ['fk-method-badge', `fk-method-badge--${this.method()}`, this.className()]
|
|
21
|
-
.filter(Boolean)
|
|
22
|
-
.join(' '), ...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
23
|
-
label = computed(() => this.method().toUpperCase(), ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
24
|
-
get hostClass() {
|
|
25
|
-
return this.classes();
|
|
26
|
-
}
|
|
27
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodBadgeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
28
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.9", type: MethodBadgeComponent, isStandalone: true, selector: "fk-method-badge", inputs: { method: { classPropertyName: "method", publicName: "method", isSignal: true, isRequired: true, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<span\n class=\"fk-method-badge__label\"\n [id]=\"id() ?? undefined\"\n [attr.aria-label]=\"ariaLabel()\"\n >{{ label() }}</span\n>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;min-width:var(--fk-method-badge-min-width, 3rem);padding:var(--fk-method-badge-padding-block, 2px) var(--fk-method-badge-padding-inline, var(--fk-rhythm-2, .5rem));border-radius:var(--fk-method-badge-radius, var(--fk-radius-sm, .25rem));background-color:var(--fk-method-badge-bg, var(--fk-method-badge-bg-neutral, #d6d6d6));color:var(--fk-method-badge-color, var(--fk-color-text, #1f2d3d));font-family:var(--fk-method-badge-font-family, var(--fk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace));font-size:var(--fk-method-badge-font-size, .6875rem);font-weight:var(--fk-method-badge-font-weight, var(--fk-font-weight-bold, 700));letter-spacing:.05em;line-height:1.4;text-transform:uppercase}:host.fk-method-badge--get{background-color:var(--fk-method-badge-bg-get, #89ecac);color:var(--fk-method-badge-color-get, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--post{background-color:var(--fk-method-badge-bg-post, #94c4fd);color:var(--fk-method-badge-color-post, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--put{background-color:var(--fk-method-badge-bg-put, #fbb972);color:var(--fk-method-badge-color-put, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--patch{background-color:var(--fk-method-badge-bg-patch, #c8a7fb);color:var(--fk-method-badge-color-patch, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--delete{background-color:var(--fk-method-badge-bg-delete, #fb8d8d);color:var(--fk-method-badge-color-delete, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--head{background-color:var(--fk-method-badge-bg-head, var(--fk-method-badge-bg-neutral, #d6d6d6));color:var(--fk-method-badge-color-head, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--options{background-color:var(--fk-method-badge-bg-options, var(--fk-method-badge-bg-neutral, #d6d6d6));color:var(--fk-method-badge-color-options, var(--fk-color-text, #1f2d3d))}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
29
|
-
}
|
|
30
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: MethodBadgeComponent, decorators: [{
|
|
31
|
-
type: Component,
|
|
32
|
-
args: [{ selector: 'fk-method-badge', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span\n class=\"fk-method-badge__label\"\n [id]=\"id() ?? undefined\"\n [attr.aria-label]=\"ariaLabel()\"\n >{{ label() }}</span\n>\n", styles: [":host{display:inline-flex;align-items:center;justify-content:center;min-width:var(--fk-method-badge-min-width, 3rem);padding:var(--fk-method-badge-padding-block, 2px) var(--fk-method-badge-padding-inline, var(--fk-rhythm-2, .5rem));border-radius:var(--fk-method-badge-radius, var(--fk-radius-sm, .25rem));background-color:var(--fk-method-badge-bg, var(--fk-method-badge-bg-neutral, #d6d6d6));color:var(--fk-method-badge-color, var(--fk-color-text, #1f2d3d));font-family:var(--fk-method-badge-font-family, var(--fk-font-family-mono, ui-monospace, SFMono-Regular, Menlo, monospace));font-size:var(--fk-method-badge-font-size, .6875rem);font-weight:var(--fk-method-badge-font-weight, var(--fk-font-weight-bold, 700));letter-spacing:.05em;line-height:1.4;text-transform:uppercase}:host.fk-method-badge--get{background-color:var(--fk-method-badge-bg-get, #89ecac);color:var(--fk-method-badge-color-get, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--post{background-color:var(--fk-method-badge-bg-post, #94c4fd);color:var(--fk-method-badge-color-post, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--put{background-color:var(--fk-method-badge-bg-put, #fbb972);color:var(--fk-method-badge-color-put, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--patch{background-color:var(--fk-method-badge-bg-patch, #c8a7fb);color:var(--fk-method-badge-color-patch, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--delete{background-color:var(--fk-method-badge-bg-delete, #fb8d8d);color:var(--fk-method-badge-color-delete, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--head{background-color:var(--fk-method-badge-bg-head, var(--fk-method-badge-bg-neutral, #d6d6d6));color:var(--fk-method-badge-color-head, var(--fk-color-text, #1f2d3d))}:host.fk-method-badge--options{background-color:var(--fk-method-badge-bg-options, var(--fk-method-badge-bg-neutral, #d6d6d6));color:var(--fk-method-badge-color-options, var(--fk-color-text, #1f2d3d))}\n"] }]
|
|
33
|
-
}], propDecorators: { method: [{ type: i0.Input, args: [{ isSignal: true, alias: "method", required: true }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], hostClass: [{
|
|
34
|
-
type: HostBinding,
|
|
35
|
-
args: ['class']
|
|
36
|
-
}] } });
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Generated bundle index. Do not edit.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
export { MethodBadgeComponent };
|
|
43
|
-
//# sourceMappingURL=frame-kit-ui-ng-docs-method-badge.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"frame-kit-ui-ng-docs-method-badge.mjs","sources":["../../../../packages/ui-ng/docs/method-badge/method-badge.component.ts","../../../../packages/ui-ng/docs/method-badge/method-badge.component.html","../../../../packages/ui-ng/docs/method-badge/frame-kit-ui-ng-docs-method-badge.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n computed,\n HostBinding,\n input,\n} from '@angular/core';\n\nimport type { MethodBadgeMethod } from './method-badge.types';\n\n/**\n * Small rectangular badge showing an HTTP method label (e.g. `GET`, `POST`).\n *\n * Each method has its own hue so consumers can identify the verb in a dense\n * list. Background colors are exposed as CSS variables\n * (`--fk-method-badge-bg-get`, etc.) with defaults baked in so the component\n * renders correctly without a theme.\n */\n@Component({\n selector: 'fk-method-badge',\n standalone: true,\n imports: [],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './method-badge.component.html',\n styleUrl: './method-badge.component.scss',\n})\nexport class MethodBadgeComponent {\n // ===== INPUTS =====\n readonly method = input.required<MethodBadgeMethod>();\n\n // ===== BASE PROPS =====\n readonly className = input<string>('');\n readonly id = input<string | null>(null);\n readonly ariaLabel = input<string | null>(null);\n\n // ===== COMPUTED =====\n readonly classes = computed(() =>\n ['fk-method-badge', `fk-method-badge--${this.method()}`, this.className()]\n .filter(Boolean)\n .join(' '),\n );\n\n readonly label = computed(() => this.method().toUpperCase());\n\n @HostBinding('class')\n get hostClass(): string {\n return this.classes();\n }\n}\n","<span\n class=\"fk-method-badge__label\"\n [id]=\"id() ?? undefined\"\n [attr.aria-label]=\"ariaLabel()\"\n >{{ label() }}</span\n>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAUA;;;;;;;AAOG;MASU,oBAAoB,CAAA;;AAEtB,IAAA,MAAM,GAAG,KAAK,CAAC,QAAQ,4EAAqB;;AAG5C,IAAA,SAAS,GAAG,KAAK,CAAS,EAAE,gFAAC;AAC7B,IAAA,EAAE,GAAG,KAAK,CAAgB,IAAI,yEAAC;AAC/B,IAAA,SAAS,GAAG,KAAK,CAAgB,IAAI,gFAAC;;IAGtC,OAAO,GAAG,QAAQ,CAAC,MAC1B,CAAC,iBAAiB,EAAE,CAAA,iBAAA,EAAoB,IAAI,CAAC,MAAM,EAAE,CAAA,CAAE,EAAE,IAAI,CAAC,SAAS,EAAE;SACtE,MAAM,CAAC,OAAO;AACd,SAAA,IAAI,CAAC,GAAG,CAAC,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,SAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CACb;AAEQ,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC,WAAW,EAAE,4EAAC;AAE5D,IAAA,IACI,SAAS,GAAA;AACX,QAAA,OAAO,IAAI,CAAC,OAAO,EAAE;IACvB;uGArBW,oBAAoB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAApB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,oBAAoB,6nBC1BjC,2IAMA,EAAA,MAAA,EAAA,CAAA,k6DAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FDoBa,oBAAoB,EAAA,UAAA,EAAA,CAAA;kBARhC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,iBAAiB,cACf,IAAI,EAAA,OAAA,EACP,EAAE,EAAA,eAAA,EACM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2IAAA,EAAA,MAAA,EAAA,CAAA,k6DAAA,CAAA,EAAA;;sBAsB9C,WAAW;uBAAC,OAAO;;;AE5CtB;;AAEG;;;;"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { MethodBadgeMethod } from '@frame-kit/ui-ng/docs/method-badge';
|
|
3
|
-
export { MethodBadgeMethod as EndpointLinkMethod } from '@frame-kit/ui-ng/docs/method-badge';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Sidebar/list item for an API endpoint in developer documentation.
|
|
7
|
-
*
|
|
8
|
-
* Renders a leading `fk-method-badge` followed by the endpoint label as a
|
|
9
|
-
* single clickable router link. Used to list operations (e.g. "GET List
|
|
10
|
-
* permissions", "POST Create identity") in a documentation sidebar or any
|
|
11
|
-
* denser endpoint index.
|
|
12
|
-
*
|
|
13
|
-
* Active state is driven by `routerLinkActive`, matching the behavior of
|
|
14
|
-
* `fk-sidenav-link` so every router-aware nav item in the library resolves
|
|
15
|
-
* active state the same way.
|
|
16
|
-
*
|
|
17
|
-
* When rendered inside an `fk-app-shell`, clicks also call `dismissSidenav`
|
|
18
|
-
* on the ancestor shell — this closes the mobile overlay so the user lands
|
|
19
|
-
* directly on the selected endpoint. On desktop it's a no-op.
|
|
20
|
-
*/
|
|
21
|
-
declare class EndpointLinkComponent {
|
|
22
|
-
private readonly shell;
|
|
23
|
-
readonly method: _angular_core.InputSignal<MethodBadgeMethod>;
|
|
24
|
-
readonly label: _angular_core.InputSignal<string>;
|
|
25
|
-
readonly routerLink: _angular_core.InputSignal<string | any[]>;
|
|
26
|
-
/**
|
|
27
|
-
* Whether to require an exact URL match for the active state. Defaults to
|
|
28
|
-
* false — each endpoint has a unique final path segment so prefix matching
|
|
29
|
-
* resolves to the same thing in practice.
|
|
30
|
-
*/
|
|
31
|
-
readonly exact: _angular_core.InputSignal<boolean>;
|
|
32
|
-
readonly className: _angular_core.InputSignal<string>;
|
|
33
|
-
readonly classes: _angular_core.Signal<string>;
|
|
34
|
-
readonly activeOptions: _angular_core.Signal<{
|
|
35
|
-
exact: boolean;
|
|
36
|
-
}>;
|
|
37
|
-
get hostClass(): string;
|
|
38
|
-
protected dismiss(): void;
|
|
39
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EndpointLinkComponent, never>;
|
|
40
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EndpointLinkComponent, "fk-endpoint-link", never, { "method": { "alias": "method"; "required": true; "isSignal": true; }; "label": { "alias": "label"; "required": true; "isSignal": true; }; "routerLink": { "alias": "routerLink"; "required": true; "isSignal": true; }; "exact": { "alias": "exact"; "required": false; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export { EndpointLinkComponent };
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as _angular_core from '@angular/core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Supported HTTP methods for `fk-method-badge`. Lowercased to match OpenAPI
|
|
5
|
-
* conventions so consumers can pass spec values directly without translation.
|
|
6
|
-
*/
|
|
7
|
-
type MethodBadgeMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Small rectangular badge showing an HTTP method label (e.g. `GET`, `POST`).
|
|
11
|
-
*
|
|
12
|
-
* Each method has its own hue so consumers can identify the verb in a dense
|
|
13
|
-
* list. Background colors are exposed as CSS variables
|
|
14
|
-
* (`--fk-method-badge-bg-get`, etc.) with defaults baked in so the component
|
|
15
|
-
* renders correctly without a theme.
|
|
16
|
-
*/
|
|
17
|
-
declare class MethodBadgeComponent {
|
|
18
|
-
readonly method: _angular_core.InputSignal<MethodBadgeMethod>;
|
|
19
|
-
readonly className: _angular_core.InputSignal<string>;
|
|
20
|
-
readonly id: _angular_core.InputSignal<string | null>;
|
|
21
|
-
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
22
|
-
readonly classes: _angular_core.Signal<string>;
|
|
23
|
-
readonly label: _angular_core.Signal<string>;
|
|
24
|
-
get hostClass(): string;
|
|
25
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<MethodBadgeComponent, never>;
|
|
26
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<MethodBadgeComponent, "fk-method-badge", never, { "method": { "alias": "method"; "required": true; "isSignal": true; }; "className": { "alias": "className"; "required": false; "isSignal": true; }; "id": { "alias": "id"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export { MethodBadgeComponent };
|
|
30
|
-
export type { MethodBadgeMethod };
|