@waaelg/dga-design-system 0.4.2 → 0.4.3
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/README.md +23 -23
- package/dist/DGA-logo-icon.svg +55 -0
- package/dist/arrow_left.svg +3 -0
- package/dist/arrow_left_black.svg +3 -0
- package/dist/arrow_right.svg +3 -0
- package/dist/arrow_right_black.svg +3 -0
- package/dist/chevron.svg +0 -0
- package/dist/index.js +253 -0
- package/dist/index.js.map +1 -0
- package/dist/link-icon.svg +19 -0
- package/dist/marker.svg +1 -0
- package/dist/saudiFlag.svg +13 -0
- package/dist/square-lock-password.svg +20 -0
- package/dist/style.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +24 -7
- package/docs/README.md +0 -76
- package/docs/changelog.md +0 -54
- package/docs/components/accordion.md +0 -114
- package/docs/components/alert.md +0 -130
- package/docs/components/avatar.md +0 -74
- package/docs/components/breadcrumb.md +0 -56
- package/docs/components/button.md +0 -163
- package/docs/components/card.md +0 -78
- package/docs/components/chart.md +0 -97
- package/docs/components/code-snippet.md +0 -110
- package/docs/components/divider.md +0 -54
- package/docs/components/forms.md +0 -123
- package/docs/components/link.md +0 -52
- package/docs/components/navbar.md +0 -93
- package/docs/components/table.md +0 -69
- package/docs/components/tag.md +0 -76
- package/docs/components/verify-bar.md +0 -79
- package/docs/foundations/colors-cheatsheet.md +0 -593
- package/docs/foundations/colors-swatches.md +0 -441
- package/docs/foundations/colors.md +0 -1284
- package/docs/foundations/grid.md +0 -1406
- package/docs/foundations/radius.md +0 -1166
- package/docs/foundations/spacing.md +0 -134
- package/docs/foundations/typography.md +0 -111
- package/docs/foundations/width-height.md +0 -305
- package/docs/getting-started/installation.md +0 -158
- package/docs/getting-started/javascript-api.md +0 -204
- package/docs/getting-started/rtl-arabic.md +0 -89
- package/docs/getting-started/web-components.md +0 -134
package/dist/vite.svg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
package/package.json
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@waaelg/dga-design-system",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "Saudi DGA design system — compiled CSS utilities, components, and JavaScript for interactive behavior.",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
5
8
|
"exports": {
|
|
6
|
-
".":
|
|
7
|
-
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./style.css": {
|
|
14
|
+
"import": "./dist/style.css",
|
|
15
|
+
"default": "./dist/style.css"
|
|
16
|
+
}
|
|
8
17
|
},
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./dist/style.css",
|
|
20
|
+
"./dist/index.js"
|
|
21
|
+
],
|
|
9
22
|
"files": [
|
|
10
23
|
"dist",
|
|
11
|
-
"README.md"
|
|
12
|
-
"docs"
|
|
24
|
+
"README.md"
|
|
13
25
|
],
|
|
14
26
|
"repository": {
|
|
15
27
|
"type": "git",
|
|
@@ -18,12 +30,17 @@
|
|
|
18
30
|
"scripts": {
|
|
19
31
|
"dev": "vite",
|
|
20
32
|
"build": "vite build",
|
|
21
|
-
"
|
|
33
|
+
"prepack": "npm run build",
|
|
34
|
+
"preview": "vite preview",
|
|
35
|
+
"docs:dev": "vitepress dev docs",
|
|
36
|
+
"docs:build": "vitepress build docs",
|
|
37
|
+
"docs:preview": "vitepress preview docs"
|
|
22
38
|
},
|
|
23
39
|
"devDependencies": {
|
|
24
40
|
"@types/node": "^24.9.1",
|
|
25
41
|
"sass": "^1.93.2",
|
|
26
|
-
"vite": "^7.1.7"
|
|
42
|
+
"vite": "^7.1.7",
|
|
43
|
+
"vitepress": "^1.6.4"
|
|
27
44
|
},
|
|
28
45
|
"dependencies": {
|
|
29
46
|
"@popperjs/core": "^2.11.8",
|
package/docs/README.md
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
# DGA Design System — Documentation
|
|
2
|
-
|
|
3
|
-
Documentation for **@waaelg/dga-design-on-sass**: Saudi DGA design system utilities, components, and optional JavaScript.
|
|
4
|
-
|
|
5
|
-
**Package:** [npm](https://www.npmjs.com/package/@waaelg/dga-design-on-sass) · **Demo:** run `npm run dev` in the repo root
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Getting Started
|
|
10
|
-
|
|
11
|
-
| Doc | Description |
|
|
12
|
-
|-----|-------------|
|
|
13
|
-
| [Installation](./getting-started/installation.md) | npm, HTML, ASP.NET, Vue, React |
|
|
14
|
-
| [JavaScript API](./getting-started/javascript-api.md) | Interactive component classes |
|
|
15
|
-
| [Web Components](./getting-started/web-components.md) | `<dga-*>` custom elements |
|
|
16
|
-
| [RTL & Arabic](./getting-started/rtl-arabic.md) | Right-to-left setup |
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Foundations
|
|
21
|
-
|
|
22
|
-
| Doc | Description |
|
|
23
|
-
|-----|-------------|
|
|
24
|
-
| [Colors](./foundations/colors.md) | Palettes, semantic colors, utilities |
|
|
25
|
-
| [Colors cheatsheet](./foundations/colors-cheatsheet.md) | Quick class reference |
|
|
26
|
-
| [Color swatches](./foundations/colors-swatches.md) | Hex values per shade |
|
|
27
|
-
| [Typography](./foundations/typography.md) | Display, text sizes, weights |
|
|
28
|
-
| [Spacing](./foundations/spacing.md) | Padding, margin, gap |
|
|
29
|
-
| [Grid & Flex](./foundations/grid.md) | Layout, flexbox, display |
|
|
30
|
-
| [Width & Height](./foundations/width-height.md) | `dga-w-*`, `dga-h-*` |
|
|
31
|
-
| [Border radius](./foundations/radius.md) | Radius utilities |
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Components
|
|
36
|
-
|
|
37
|
-
| Component | Doc | Demo | JS / WC |
|
|
38
|
-
|-----------|-----|------|---------|
|
|
39
|
-
| Button | [button.md](./components/button.md) | `index.html` | No |
|
|
40
|
-
| Alert | [alert.md](./components/alert.md) | `alerts.html` | WC or class |
|
|
41
|
-
| Accordion | [accordion.md](./components/accordion.md) | `index.html` | WC or class |
|
|
42
|
-
| Navbar | [navbar.md](./components/navbar.md) | `index.html` | Yes |
|
|
43
|
-
| Card | [card.md](./components/card.md) | `index.html` | No |
|
|
44
|
-
| Forms | [forms.md](./components/forms.md) | `index.html` | No |
|
|
45
|
-
| Table | [table.md](./components/table.md) | `index.html` | No |
|
|
46
|
-
| Breadcrumb | [breadcrumb.md](./components/breadcrumb.md) | `index.html` | No |
|
|
47
|
-
| Link | [link.md](./components/link.md) | `index.html` | No |
|
|
48
|
-
| Tag | [tag.md](./components/tag.md) | `index.html` | No |
|
|
49
|
-
| Divider | [divider.md](./components/divider.md) | `index.html` | No |
|
|
50
|
-
| Code snippet | [code-snippet.md](./components/code-snippet.md) | `index.html` | WC or class |
|
|
51
|
-
| Pie chart | [chart.md](./components/chart.md) | `index.html` | WC or class |
|
|
52
|
-
| Verify bar | [verify-bar.md](./components/verify-bar.md) | `verify-bar.html` | WC or class |
|
|
53
|
-
| Avatar | [avatar.md](./components/avatar.md) | — | No |
|
|
54
|
-
|
|
55
|
-
**WC** = web component (`<dga-*>`) registered on package import.
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Changelog
|
|
60
|
-
|
|
61
|
-
See [changelog.md](./changelog.md).
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## Doc conventions
|
|
66
|
-
|
|
67
|
-
Every component page includes:
|
|
68
|
-
|
|
69
|
-
1. Overview
|
|
70
|
-
2. HTML structure
|
|
71
|
-
3. Classes and variants (from source SCSS)
|
|
72
|
-
4. Copy-paste examples (from demo HTML)
|
|
73
|
-
5. JavaScript setup (if needed)
|
|
74
|
-
6. Accessibility notes
|
|
75
|
-
|
|
76
|
-
Class names are verified against `dist/style.css` after `npm run build`.
|
package/docs/changelog.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to **@waaelg/dga-design-on-sass**.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## [0.4.0] — 2026-06-29
|
|
8
|
-
|
|
9
|
-
### Added
|
|
10
|
-
- Web components: `<dga-alert>`, `<dga-accordion>`, `<dga-code-snippet>`, `<dga-pie-chart>`
|
|
11
|
-
- [Web Components guide](./getting-started/web-components.md)
|
|
12
|
-
- Full documentation under `docs/`:
|
|
13
|
-
- Getting started (installation, JS API, RTL, web components)
|
|
14
|
-
- Foundations (`colors`, `grid`, `width-height`, `radius`, typography, spacing)
|
|
15
|
-
- All 15 component docs
|
|
16
|
-
|
|
17
|
-
### Changed
|
|
18
|
-
- Legacy JS classes share utilities with web components (`src/scripts/shared/`)
|
|
19
|
-
- Foundation docs moved to `docs/foundations/` with npm quick-start sections
|
|
20
|
-
- Alert, accordion, code snippet, and chart docs: legacy + web component options
|
|
21
|
-
- JavaScript API and README: web component registration and usage
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## [0.3.9]
|
|
26
|
-
|
|
27
|
-
### Added
|
|
28
|
-
- Height utilities (`dga-h-*`, `dga-max-h-*`, `dga-min-h-*`)
|
|
29
|
-
- Flex direction aliases: `dga-flex-column`, `dga-flex-column-reverse`
|
|
30
|
-
- Avatar component in build (`components/avatar`)
|
|
31
|
-
- Initial documentation under `docs/`
|
|
32
|
-
|
|
33
|
-
### Changed
|
|
34
|
-
- Grid documentation: width/height section, justify-content table
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
## [0.3.8]
|
|
39
|
-
|
|
40
|
-
- Published npm package with compiled `dist/`
|
|
41
|
-
- Grid, color, radius utilities
|
|
42
|
-
- Components: button, alert, accordion, navbar, card, forms, table, verify bar, code snippet, chart
|
|
43
|
-
- JavaScript exports: `DGAAccordion`, `DGAAlert`, `DGAChart`, `DGACodeSnippet`, `DGAMenuDropDown`, `DGAVerifyBar`
|
|
44
|
-
- `<dga-verify-bar>` web component
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Versioning
|
|
49
|
-
|
|
50
|
-
This project uses [Semantic Versioning](https://semver.org/):
|
|
51
|
-
|
|
52
|
-
- **Patch** — bug fixes, doc updates, new utility classes
|
|
53
|
-
- **Minor** — new components or features (backward compatible)
|
|
54
|
-
- **Major** — breaking class renames or API changes
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# Accordion
|
|
2
|
-
|
|
3
|
-
Expandable sections for FAQs and grouped content.
|
|
4
|
-
|
|
5
|
-
**Source:** `src/styles/components/accordion.scss`, `src/scripts/accordion.js`, `src/scripts/dga-accordion.js`
|
|
6
|
-
**Demo:** `index.html`
|
|
7
|
-
**JavaScript:** Optional — web component or `DGAAccordion` class
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Option 1: Web component (recommended)
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<dga-accordion>
|
|
15
|
-
<dga-accordion-item title="What is an accordion?">
|
|
16
|
-
An accordion lets users expand and collapse sections of content.
|
|
17
|
-
</dga-accordion-item>
|
|
18
|
-
<dga-accordion-item title="How do I use it?" size="lg" open>
|
|
19
|
-
Import the package once — no manual JS init required.
|
|
20
|
-
</dga-accordion-item>
|
|
21
|
-
</dga-accordion>
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
### `dga-accordion-item` attributes
|
|
25
|
-
|
|
26
|
-
| Attribute | Default | Description |
|
|
27
|
-
|-----------|---------|-------------|
|
|
28
|
-
| `title` | — | Header label |
|
|
29
|
-
| `size` | `md` | `sm`, `md`, or `lg` |
|
|
30
|
-
| `open` | — | Present = expanded on load |
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Option 2: Legacy markup + DGAAccordion
|
|
35
|
-
|
|
36
|
-
```html
|
|
37
|
-
<div class="dga-acc" id="myAccordion">
|
|
38
|
-
<div class="dga-acc-item">
|
|
39
|
-
<button class="dga-acc-header" aria-expanded="false">
|
|
40
|
-
<span>What is an accordion?</span>
|
|
41
|
-
</button>
|
|
42
|
-
<div class="dga-acc-content">
|
|
43
|
-
<div class="dga-acc-body">
|
|
44
|
-
An accordion lets users expand and collapse sections of content.
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
```js
|
|
52
|
-
import { DGAAccordion } from '@waaelg/dga-design-on-sass'
|
|
53
|
-
new DGAAccordion(document.getElementById('myAccordion'))
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## HTML structure (legacy)
|
|
59
|
-
|
|
60
|
-
| Element | Class |
|
|
61
|
-
|---------|-------|
|
|
62
|
-
| Root | `dga-acc` |
|
|
63
|
-
| Item | `dga-acc-item` |
|
|
64
|
-
| Header (button) | `dga-acc-header` |
|
|
65
|
-
| Content wrapper | `dga-acc-content` |
|
|
66
|
-
| Body | `dga-acc-body` |
|
|
67
|
-
|
|
68
|
-
Open state: `dga-acc-item--active` on the item (added by JS).
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Header sizes
|
|
73
|
-
|
|
74
|
-
| Attribute | Height |
|
|
75
|
-
|-----------|--------|
|
|
76
|
-
| `data-size="sm"` | 40px |
|
|
77
|
-
| `data-size="md"` | 48px (default) |
|
|
78
|
-
| `data-size="lg"` | 56px |
|
|
79
|
-
|
|
80
|
-
```html
|
|
81
|
-
<button class="dga-acc-header" data-size="lg" aria-expanded="false">Large header</button>
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
Web component: `size="lg"` on `<dga-accordion-item>`.
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## Behavior
|
|
89
|
-
|
|
90
|
-
- Click header to toggle
|
|
91
|
-
- Keyboard: Enter / Space on focused header
|
|
92
|
-
- Sets `aria-expanded` on the header
|
|
93
|
-
- Multiple panels can be open at once
|
|
94
|
-
|
|
95
|
-
---
|
|
96
|
-
|
|
97
|
-
## RTL
|
|
98
|
-
|
|
99
|
-
Chevron icon flips automatically in RTL. Optional: `dir="rtl"` on header.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## Accessibility
|
|
104
|
-
|
|
105
|
-
- Use `<button>` for headers, not `<div>`
|
|
106
|
-
- Set `aria-expanded="true"` / `"false"`
|
|
107
|
-
- Web component handles this automatically
|
|
108
|
-
|
|
109
|
-
---
|
|
110
|
-
|
|
111
|
-
## Related
|
|
112
|
-
|
|
113
|
-
- [Web Components](../getting-started/web-components.md)
|
|
114
|
-
- [JavaScript API](../getting-started/javascript-api.md)
|
package/docs/components/alert.md
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
# Alert
|
|
2
|
-
|
|
3
|
-
Feedback messages for success, warning, error, info, and neutral states.
|
|
4
|
-
|
|
5
|
-
**Source:** `src/styles/components/alert.scss`, `src/scripts/alert.js`, `src/scripts/dga-alert.js`
|
|
6
|
-
**Demo:** `alerts.html`
|
|
7
|
-
**JavaScript:** Optional — web component or `DGAAlert` class
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Option 1: Web component (recommended)
|
|
12
|
-
|
|
13
|
-
Import the package once — registers `<dga-alert>` automatically:
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<dga-alert variant="success-color" title="Success" dismissible>
|
|
17
|
-
When successful actions need direct feedback, show it here.
|
|
18
|
-
</dga-alert>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
### Attributes
|
|
22
|
-
|
|
23
|
-
| Attribute | Default | Description |
|
|
24
|
-
|-----------|---------|-------------|
|
|
25
|
-
| `variant` | `info-color` | Alert theme (see variants below) |
|
|
26
|
-
| `title` | — | Optional heading |
|
|
27
|
-
| `dismissible` | — | Present = show close button |
|
|
28
|
-
|
|
29
|
-
```html
|
|
30
|
-
<dga-alert variant="info-white">
|
|
31
|
-
Informational message without dismiss.
|
|
32
|
-
</dga-alert>
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Dismiss fires `dga-alert-dismiss` on the element. No `new DGAAlert()` required.
|
|
36
|
-
|
|
37
|
-
Works in plain HTML, ASP.NET `.cshtml`, and SPA frameworks — see [Web Components](../getting-started/web-components.md).
|
|
38
|
-
|
|
39
|
-
---
|
|
40
|
-
|
|
41
|
-
## Option 2: Legacy markup + DGAAlert
|
|
42
|
-
|
|
43
|
-
Alerts are **HTML + CSS**. Initialize `DGAAlert` once to handle close buttons.
|
|
44
|
-
|
|
45
|
-
```html
|
|
46
|
-
<div class="dga-alert" data-variant="success-color">
|
|
47
|
-
<span class="dga-alert-icon" aria-hidden="true"></span>
|
|
48
|
-
<div class="dga-alert-content">
|
|
49
|
-
<h4 class="dga-alert-title">نجاح</h4>
|
|
50
|
-
<div class="dga-alert-body">تمت العملية بنجاح!</div>
|
|
51
|
-
</div>
|
|
52
|
-
<button class="dga-alert-close" type="button" data-alert-close aria-label="إغلاق">×</button>
|
|
53
|
-
</div>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
```js
|
|
57
|
-
import { DGAAlert } from '@waaelg/dga-design-on-sass'
|
|
58
|
-
new DGAAlert()
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## HTML structure (legacy)
|
|
64
|
-
|
|
65
|
-
| Element | Class | Required |
|
|
66
|
-
|---------|-------|----------|
|
|
67
|
-
| Root | `dga-alert` | Yes |
|
|
68
|
-
| Icon | `dga-alert-icon` | Recommended |
|
|
69
|
-
| Content wrapper | `dga-alert-content` | Yes |
|
|
70
|
-
| Title | `dga-alert-title` | Optional |
|
|
71
|
-
| Body | `dga-alert-body` | Yes |
|
|
72
|
-
| Close button | `dga-alert-close` + `data-alert-close` | Optional |
|
|
73
|
-
|
|
74
|
-
Set variant on the root: `data-variant="success-color"` (legacy) or `variant="success-color"` (web component).
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Variants
|
|
79
|
-
|
|
80
|
-
Two themes: **color** (filled accent) and **white** (light background).
|
|
81
|
-
|
|
82
|
-
| Value | Status |
|
|
83
|
-
|-------|--------|
|
|
84
|
-
| `success-color` | Success (color theme) |
|
|
85
|
-
| `success-white` | Success (white theme) |
|
|
86
|
-
| `warning-color` | Warning (color) |
|
|
87
|
-
| `warning-white` | Warning (white) |
|
|
88
|
-
| `destructive-color` | Error / destructive (color) |
|
|
89
|
-
| `destructive-white` | Error / destructive (white) |
|
|
90
|
-
| `info-color` | Info (color) |
|
|
91
|
-
| `info-white` | Info (white) |
|
|
92
|
-
| `neutral-color` | Neutral (color) |
|
|
93
|
-
| `neutral-white` | Neutral (white) |
|
|
94
|
-
|
|
95
|
-
Use **color** variants on light pages; **white** variants on dense or colored backgrounds.
|
|
96
|
-
|
|
97
|
-
---
|
|
98
|
-
|
|
99
|
-
## JavaScript (legacy)
|
|
100
|
-
|
|
101
|
-
### Vanilla
|
|
102
|
-
|
|
103
|
-
```js
|
|
104
|
-
import '@waaelg/dga-design-on-sass/style.css'
|
|
105
|
-
import { DGAAlert } from '@waaelg/dga-design-on-sass'
|
|
106
|
-
|
|
107
|
-
const alert = new DGAAlert()
|
|
108
|
-
// alert.destroy() when removing listener
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
Listens for clicks on `[data-alert-close]` and hides the parent `.dga-alert`.
|
|
112
|
-
|
|
113
|
-
For new projects, prefer `<dga-alert>` instead — see [Web Components](../getting-started/web-components.md).
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Accessibility
|
|
118
|
-
|
|
119
|
-
- Close button: `aria-label` (e.g. "Dismiss alert" / "إغلاق")
|
|
120
|
-
- Icon: `aria-hidden="true"` (decorative)
|
|
121
|
-
- Use clear title + body text
|
|
122
|
-
- Do not rely on color alone — title conveys status
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## Related
|
|
127
|
-
|
|
128
|
-
- [Web Components](../getting-started/web-components.md)
|
|
129
|
-
- [JavaScript API](../getting-started/javascript-api.md)
|
|
130
|
-
- [Colors](../foundations/colors.md)
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
# Avatar
|
|
2
|
-
|
|
3
|
-
User profile images in circular or square shapes.
|
|
4
|
-
|
|
5
|
-
**Source:** `src/styles/components/avatar.scss`
|
|
6
|
-
**Demo:** _not in index.html yet_
|
|
7
|
-
**JavaScript required:** No
|
|
8
|
-
|
|
9
|
-
> **Note:** Avatar is included in the build as of the next release. Rebuild with `npm run build` after pulling latest source.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## HTML
|
|
14
|
-
|
|
15
|
-
```html
|
|
16
|
-
<div class="dga-avatar" data-size="md">
|
|
17
|
-
<img src="user.jpg" alt="User name" />
|
|
18
|
-
</div>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Sizes
|
|
24
|
-
|
|
25
|
-
| `data-size` | Dimensions |
|
|
26
|
-
|-------------|------------|
|
|
27
|
-
| `xs` | 24px |
|
|
28
|
-
| `sm` | 32px |
|
|
29
|
-
| `md` | 40px |
|
|
30
|
-
| `lg` | 48px |
|
|
31
|
-
| `xl` | 64px |
|
|
32
|
-
| `2xl` | 80px |
|
|
33
|
-
| `3xl` | 120px |
|
|
34
|
-
|
|
35
|
-
```html
|
|
36
|
-
<div class="dga-avatar" data-size="lg">
|
|
37
|
-
<img src="avatar.png" alt="" />
|
|
38
|
-
</div>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Shape
|
|
44
|
-
|
|
45
|
-
| Attribute | Shape |
|
|
46
|
-
|-----------|-------|
|
|
47
|
-
| (default) / `data-square="false"` | Circle |
|
|
48
|
-
| `data-square="true"` | Rounded square (4px radius) |
|
|
49
|
-
|
|
50
|
-
```html
|
|
51
|
-
<div class="dga-avatar" data-size="md" data-square="true">
|
|
52
|
-
<img src="logo.png" alt="Organization" />
|
|
53
|
-
</div>
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
## Styling
|
|
59
|
-
|
|
60
|
-
- White 2px border
|
|
61
|
-
- `object-fit: cover` on images
|
|
62
|
-
- `overflow: hidden`
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Enable in build
|
|
67
|
-
|
|
68
|
-
Avatar is imported in `src/styles/main.scss`. Run `npm run build` to include styles in `dist/style.css`.
|
|
69
|
-
|
|
70
|
-
---
|
|
71
|
-
|
|
72
|
-
## Related
|
|
73
|
-
|
|
74
|
-
- [Card](./card.md)
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# Breadcrumb
|
|
2
|
-
|
|
3
|
-
Navigation trail showing the current page hierarchy.
|
|
4
|
-
|
|
5
|
-
**Source:** `src/styles/components/breadcrumb.scss`
|
|
6
|
-
**Demo:** `index.html`
|
|
7
|
-
**JavaScript required:** No
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## HTML
|
|
12
|
-
|
|
13
|
-
```html
|
|
14
|
-
<div class="dga-breadcrumb">
|
|
15
|
-
<a class="dga-breadcrumb-item" href="/">Home</a>
|
|
16
|
-
<a class="dga-breadcrumb-item" href="/about">About</a>
|
|
17
|
-
<a class="dga-breadcrumb-item" href="/vision" data-current="true">Our vision</a>
|
|
18
|
-
</div>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
## Classes
|
|
24
|
-
|
|
25
|
-
| Class | Purpose |
|
|
26
|
-
|-------|---------|
|
|
27
|
-
| `dga-breadcrumb` | Flex container |
|
|
28
|
-
| `dga-breadcrumb-item` | Each crumb link |
|
|
29
|
-
| `data-current="true"` | Current (last) item — muted color |
|
|
30
|
-
|
|
31
|
-
---
|
|
32
|
-
|
|
33
|
-
## RTL
|
|
34
|
-
|
|
35
|
-
Separator chevron flips automatically when `dir="rtl"` is on a parent:
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<div class="dga-breadcrumb" dir="rtl">
|
|
39
|
-
<a class="dga-breadcrumb-item" href="#">الرئيسية</a>
|
|
40
|
-
<a class="dga-breadcrumb-item" data-current="true">رؤيتنا</a>
|
|
41
|
-
</div>
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
---
|
|
45
|
-
|
|
46
|
-
## Accessibility
|
|
47
|
-
|
|
48
|
-
- Use `<nav aria-label="Breadcrumb">` wrapper in production
|
|
49
|
-
- Current page: `aria-current="page"` on the last link
|
|
50
|
-
- Ensure links are keyboard focusable
|
|
51
|
-
|
|
52
|
-
---
|
|
53
|
-
|
|
54
|
-
## Related
|
|
55
|
-
|
|
56
|
-
- [Link](./link.md)
|