@appdirect/design-system 0.0.1 → 0.0.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.
@@ -2,6 +2,7 @@
2
2
 
3
3
  import React from 'react';
4
4
  import { Card } from '../../DataDisplay/Card';
5
+ import { Alert } from '../../DataDisplay/Alert';
5
6
  import { Stack, Inline, Box } from '../../Layout';
6
7
  import { Title } from '../../Typography/Title';
7
8
  import { Text } from '../../Typography/Text';
@@ -9,7 +10,7 @@ import { Switch } from '../../Inputs/Switch';
9
10
  import { Select } from '../../Combobox/Select';
10
11
  import { Menu } from '../../Overlays/Menu';
11
12
  import { ActionIcon } from '../../Buttons/ActionIcon';
12
- import { RiMore2Fill, RiArrowRightSLine } from '@remixicon/react';
13
+ import { RiMore2Fill, RiArrowRightSLine, RiEditLine } from '@remixicon/react';
13
14
 
14
15
  // ========================== TYPES ==========================
15
16
 
@@ -25,7 +26,17 @@ export interface DashboardWidgetLink {
25
26
  export interface DashboardWidgetProps {
26
27
  /** Widget title */
27
28
  title: string;
28
-
29
+ /** Whether the title shows an edit affordance */
30
+ editable?: boolean;
31
+ /** Callback when the edit icon is clicked */
32
+ onEdit?: () => void;
33
+
34
+ // ==================== PANEL NOTIFICATION ====================
35
+ /** Whether to show a panel notification banner below the header */
36
+ panelNotification?: boolean;
37
+ /** Content for the panel notification (ignored when panelNotification is false) */
38
+ panelNotificationMessage?: React.ReactNode;
39
+
29
40
  // ==================== HEADER CONTROLS ====================
30
41
  /** Optional switch with label and handler */
31
42
  switch?: {
@@ -128,6 +139,10 @@ export interface DashboardWidgetProps {
128
139
  */
129
140
  export function DashboardWidget({
130
141
  title,
142
+ editable = false,
143
+ onEdit,
144
+ panelNotification = false,
145
+ panelNotificationMessage,
131
146
  switch: switchConfig,
132
147
  actionsMenu,
133
148
  children,
@@ -143,9 +158,20 @@ export function DashboardWidget({
143
158
  <Inline justify="space-between" align="flex-start">
144
159
  {/* Title */}
145
160
  <Stack gap="xs">
146
- <Title order={4}>
147
- {title}
148
- </Title>
161
+ <Inline gap="xs" align="center">
162
+ <Title order={4}>
163
+ {title}
164
+ </Title>
165
+ {editable && (
166
+ <ActionIcon
167
+ size="sm"
168
+ onClick={onEdit}
169
+ aria-label="Edit title"
170
+ >
171
+ <RiEditLine size={16} />
172
+ </ActionIcon>
173
+ )}
174
+ </Inline>
149
175
  </Stack>
150
176
  {/* Header controls */}
151
177
  <Inline gap="sm" align="center">
@@ -253,7 +279,14 @@ export function DashboardWidget({
253
279
  }}
254
280
  >
255
281
  {renderHeader()}
256
-
282
+
283
+ {/* Panel notification */}
284
+ {panelNotification && (
285
+ <Alert color="info">
286
+ {panelNotificationMessage}
287
+ </Alert>
288
+ )}
289
+
257
290
  {/* Main content area - scrollable */}
258
291
  <Box style={{
259
292
  flex: 1,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.1",
2
+ "version": "0.0.3",
3
3
  "contracts": [
4
4
  {
5
5
  "id": "Alert",
@@ -86,42 +86,22 @@
86
86
  color: var(--ad-color-state-disabled-text);
87
87
  cursor: var(--ad-cursor-not-allowed);
88
88
  }
89
- .mantine-ActionIcon-root[data-size="xs"] {
90
- height: 18px;
91
- width: 18px;
92
- }
93
89
  .mantine-ActionIcon-root[data-size="xs"] svg {
94
90
  width: 12px;
95
91
  height: 12px;
96
92
  }
97
- .mantine-ActionIcon-root[data-size="sm"] {
98
- height: 22px;
99
- width: 22px;
100
- }
101
93
  .mantine-ActionIcon-root[data-size="sm"] svg {
102
94
  width: 14px;
103
95
  height: 14px;
104
96
  }
105
- .mantine-ActionIcon-root[data-size="md"] {
106
- height: 28px;
107
- width: 28px;
108
- }
109
97
  .mantine-ActionIcon-root[data-size="md"] svg {
110
98
  width: 18px;
111
99
  height: 18px;
112
100
  }
113
- .mantine-ActionIcon-root[data-size="lg"] {
114
- height: 34px;
115
- width: 34px;
116
- }
117
101
  .mantine-ActionIcon-root[data-size="lg"] svg {
118
102
  width: 20px;
119
103
  height: 20px;
120
104
  }
121
- .mantine-ActionIcon-root[data-size="xl"] {
122
- height: 44px;
123
- width: 44px;
124
- }
125
105
  .mantine-ActionIcon-root[data-size="xl"] svg {
126
106
  width: 24px;
127
107
  height: 24px;
@@ -1625,11 +1605,11 @@ fieldset:disabled .mantine-Slider-mark[data-filled] {
1625
1605
  border-bottom-width: var(--ad-border-width-thin);
1626
1606
  border-bottom-style: var(--ad-border-style-solid);
1627
1607
  padding-inline: var(--ad-spacing-md);
1628
- padding-block: var(--ad-spacing-xs);
1608
+ padding-block: var(--ad-spacing-sm);
1629
1609
  }
1630
1610
  .mantine-Table-td {
1631
1611
  padding-inline: var(--ad-spacing-md);
1632
- padding-block: var(--ad-spacing-xs);
1612
+ padding-block: var(--ad-spacing-sm);
1633
1613
  border-bottom-color: var(--ad-color-border-default);
1634
1614
  border-bottom-width: var(--ad-border-width-thin);
1635
1615
  border-bottom-style: var(--ad-border-style-solid);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appdirect/design-system",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "AppDirect Design System components. Wraps Mantine v9 with standardized props, variants, and tokens.",
5
5
  "main": "./dist/index.ts",
6
6
  "types": "./dist/index.ts",
@@ -37,7 +37,7 @@
37
37
  "prepublishOnly": "npm run build"
38
38
  },
39
39
  "dependencies": {
40
- "@appdirect/ad-design-tokens": "0.0.1",
40
+ "@appdirect/ad-design-tokens": "0.0.3",
41
41
  "@mantine/dropzone": "^9.6.0",
42
42
  "@remixicon/react": "^4.6.0",
43
43
  "@tabler/icons-react": "^3.33.0",