@extrachill/components 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface ActionRowProps {
3
+ children: ReactNode;
4
+ align?: 'start' | 'between' | 'end';
5
+ className?: string;
6
+ classPrefix?: string;
7
+ }
8
+ export declare function ActionRow({ children, align, className, classPrefix, }: ActionRowProps): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=ActionRow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActionRow.d.ts","sourceRoot":"","sources":["../src/ActionRow.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,cAAc;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,KAAK,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,SAAS,CAAE,EAC1B,QAAQ,EACR,KAAe,EACf,SAAc,EACd,WAA6B,GAC7B,EAAE,cAAc,2CAQhB"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function ActionRow({ children, align = 'start', className = '', classPrefix = 'ec-action-row', }) {
3
+ return (_jsx("div", { className: [classPrefix, `${classPrefix}--${align}`, className].filter(Boolean).join(' '), children: children }));
4
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface FieldGroupProps {
3
+ label?: ReactNode;
4
+ help?: ReactNode;
5
+ error?: ReactNode;
6
+ required?: boolean;
7
+ children: ReactNode;
8
+ className?: string;
9
+ classPrefix?: string;
10
+ htmlFor?: string;
11
+ }
12
+ export declare function FieldGroup({ label, help, error, required, children, className, classPrefix, htmlFor, }: FieldGroupProps): import("react/jsx-runtime").JSX.Element;
13
+ //# sourceMappingURL=FieldGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldGroup.d.ts","sourceRoot":"","sources":["../src/FieldGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC/B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,CAAE,EAC3B,KAAK,EACL,IAAI,EACJ,KAAK,EACL,QAAgB,EAChB,QAAQ,EACR,SAAc,EACd,WAA8B,EAC9B,OAAO,GACP,EAAE,eAAe,2CAcjB"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function FieldGroup({ label, help, error, required = false, children, className = '', classPrefix = 'ec-field-group', htmlFor, }) {
3
+ return (_jsxs("div", { className: [classPrefix, className].filter(Boolean).join(' '), children: [label && (_jsxs("label", { className: `${classPrefix}__label`, htmlFor: htmlFor, children: [label, required && _jsx("span", { className: `${classPrefix}__required`, children: " *" })] })), _jsx("div", { className: `${classPrefix}__control`, children: children }), help && _jsx("div", { className: `${classPrefix}__help`, children: help }), error && _jsx("div", { className: `${classPrefix}__error`, children: error })] }));
4
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface InlineStatusProps {
3
+ children: ReactNode;
4
+ tone: 'success' | 'error' | 'warning' | 'info';
5
+ className?: string;
6
+ classPrefix?: string;
7
+ }
8
+ export declare function InlineStatus({ children, tone, className, classPrefix, }: InlineStatusProps): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=InlineStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InlineStatus.d.ts","sourceRoot":"","sources":["../src/InlineStatus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,iBAAiB;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAE,EAC7B,QAAQ,EACR,IAAI,EACJ,SAAc,EACd,WAAgC,GAChC,EAAE,iBAAiB,2CAMnB"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function InlineStatus({ children, tone, className = '', classPrefix = 'ec-inline-status', }) {
3
+ return (_jsx("div", { className: [classPrefix, `${classPrefix}--${tone}`, className].filter(Boolean).join(' '), children: children }));
4
+ }
@@ -0,0 +1,9 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PanelProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ classPrefix?: string;
6
+ compact?: boolean;
7
+ }
8
+ export declare function Panel({ children, className, classPrefix, compact, }: PanelProps): import("react/jsx-runtime").JSX.Element;
9
+ //# sourceMappingURL=Panel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Panel.d.ts","sourceRoot":"","sources":["../src/Panel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,UAAU;IAC1B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAgB,KAAK,CAAE,EACtB,QAAQ,EACR,SAAc,EACd,WAAwB,EACxB,OAAe,GACf,EAAE,UAAU,2CAQZ"}
package/dist/Panel.js ADDED
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function Panel({ children, className = '', classPrefix = 'ec-panel', compact = false, }) {
3
+ const panelClass = [
4
+ classPrefix,
5
+ compact ? `${classPrefix}--compact` : '',
6
+ className,
7
+ ].filter(Boolean).join(' ');
8
+ return _jsx("div", { className: panelClass, children: children });
9
+ }
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface PanelHeaderProps {
3
+ title?: ReactNode;
4
+ description?: ReactNode;
5
+ actions?: ReactNode;
6
+ className?: string;
7
+ classPrefix?: string;
8
+ }
9
+ export declare function PanelHeader({ title, description, actions, className, classPrefix, }: PanelHeaderProps): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=PanelHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PanelHeader.d.ts","sourceRoot":"","sources":["../src/PanelHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,gBAAgB;IAChC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAE,EAC5B,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAc,EACd,WAA+B,GAC/B,EAAE,gBAAgB,2CAUlB"}
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function PanelHeader({ title, description, actions, className = '', classPrefix = 'ec-panel-header', }) {
3
+ return (_jsxs("div", { className: [classPrefix, className].filter(Boolean).join(' '), children: [_jsxs("div", { className: `${classPrefix}__main`, children: [title && _jsx("div", { className: `${classPrefix}__title`, children: title }), description && _jsx("div", { className: `${classPrefix}__description`, children: description })] }), actions && _jsx("div", { className: `${classPrefix}__actions`, children: actions })] }));
4
+ }
package/dist/index.d.ts CHANGED
@@ -8,4 +8,9 @@ export { Pagination, type PaginationProps } from './Pagination.tsx';
8
8
  export { SearchBox, type SearchBoxProps } from './SearchBox.tsx';
9
9
  export { Modal, type ModalProps } from './Modal.tsx';
10
10
  export { Tabs, type TabsProps, type TabItem } from './Tabs.tsx';
11
+ export { Panel, type PanelProps } from './Panel.tsx';
12
+ export { PanelHeader, type PanelHeaderProps } from './PanelHeader.tsx';
13
+ export { ActionRow, type ActionRowProps } from './ActionRow.tsx';
14
+ export { FieldGroup, type FieldGroupProps } from './FieldGroup.tsx';
15
+ export { InlineStatus, type InlineStatusProps } from './InlineStatus.tsx';
11
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,EAAE,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
package/dist/index.js CHANGED
@@ -8,3 +8,8 @@ export { Pagination } from "./Pagination.js";
8
8
  export { SearchBox } from "./SearchBox.js";
9
9
  export { Modal } from "./Modal.js";
10
10
  export { Tabs } from "./Tabs.js";
11
+ export { Panel } from "./Panel.js";
12
+ export { PanelHeader } from "./PanelHeader.js";
13
+ export { ActionRow } from "./ActionRow.js";
14
+ export { FieldGroup } from "./FieldGroup.js";
15
+ export { InlineStatus } from "./InlineStatus.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@extrachill/components",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Shared React components for the Extra Chill Platform.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface ActionRowProps {
4
+ children: ReactNode;
5
+ align?: 'start' | 'between' | 'end';
6
+ className?: string;
7
+ classPrefix?: string;
8
+ }
9
+
10
+ export function ActionRow( {
11
+ children,
12
+ align = 'start',
13
+ className = '',
14
+ classPrefix = 'ec-action-row',
15
+ }: ActionRowProps ) {
16
+ return (
17
+ <div
18
+ className={ [ classPrefix, `${ classPrefix }--${ align }`, className ].filter( Boolean ).join( ' ' ) }
19
+ >
20
+ { children }
21
+ </div>
22
+ );
23
+ }
@@ -0,0 +1,37 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface FieldGroupProps {
4
+ label?: ReactNode;
5
+ help?: ReactNode;
6
+ error?: ReactNode;
7
+ required?: boolean;
8
+ children: ReactNode;
9
+ className?: string;
10
+ classPrefix?: string;
11
+ htmlFor?: string;
12
+ }
13
+
14
+ export function FieldGroup( {
15
+ label,
16
+ help,
17
+ error,
18
+ required = false,
19
+ children,
20
+ className = '',
21
+ classPrefix = 'ec-field-group',
22
+ htmlFor,
23
+ }: FieldGroupProps ) {
24
+ return (
25
+ <div className={ [ classPrefix, className ].filter( Boolean ).join( ' ' ) }>
26
+ { label && (
27
+ <label className={ `${ classPrefix }__label` } htmlFor={ htmlFor }>
28
+ { label }
29
+ { required && <span className={ `${ classPrefix }__required` }> *</span> }
30
+ </label>
31
+ ) }
32
+ <div className={ `${ classPrefix }__control` }>{ children }</div>
33
+ { help && <div className={ `${ classPrefix }__help` }>{ help }</div> }
34
+ { error && <div className={ `${ classPrefix }__error` }>{ error }</div> }
35
+ </div>
36
+ );
37
+ }
@@ -0,0 +1,21 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface InlineStatusProps {
4
+ children: ReactNode;
5
+ tone: 'success' | 'error' | 'warning' | 'info';
6
+ className?: string;
7
+ classPrefix?: string;
8
+ }
9
+
10
+ export function InlineStatus( {
11
+ children,
12
+ tone,
13
+ className = '',
14
+ classPrefix = 'ec-inline-status',
15
+ }: InlineStatusProps ) {
16
+ return (
17
+ <div className={ [ classPrefix, `${ classPrefix }--${ tone }`, className ].filter( Boolean ).join( ' ' ) }>
18
+ { children }
19
+ </div>
20
+ );
21
+ }
package/src/Panel.tsx ADDED
@@ -0,0 +1,23 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface PanelProps {
4
+ children: ReactNode;
5
+ className?: string;
6
+ classPrefix?: string;
7
+ compact?: boolean;
8
+ }
9
+
10
+ export function Panel( {
11
+ children,
12
+ className = '',
13
+ classPrefix = 'ec-panel',
14
+ compact = false,
15
+ }: PanelProps ) {
16
+ const panelClass = [
17
+ classPrefix,
18
+ compact ? `${ classPrefix }--compact` : '',
19
+ className,
20
+ ].filter( Boolean ).join( ' ' );
21
+
22
+ return <div className={ panelClass }>{ children }</div>;
23
+ }
@@ -0,0 +1,27 @@
1
+ import type { ReactNode } from 'react';
2
+
3
+ export interface PanelHeaderProps {
4
+ title?: ReactNode;
5
+ description?: ReactNode;
6
+ actions?: ReactNode;
7
+ className?: string;
8
+ classPrefix?: string;
9
+ }
10
+
11
+ export function PanelHeader( {
12
+ title,
13
+ description,
14
+ actions,
15
+ className = '',
16
+ classPrefix = 'ec-panel-header',
17
+ }: PanelHeaderProps ) {
18
+ return (
19
+ <div className={ [ classPrefix, className ].filter( Boolean ).join( ' ' ) }>
20
+ <div className={ `${ classPrefix }__main` }>
21
+ { title && <div className={ `${ classPrefix }__title` }>{ title }</div> }
22
+ { description && <div className={ `${ classPrefix }__description` }>{ description }</div> }
23
+ </div>
24
+ { actions && <div className={ `${ classPrefix }__actions` }>{ actions }</div> }
25
+ </div>
26
+ );
27
+ }
package/src/index.tsx CHANGED
@@ -9,3 +9,8 @@ export { Pagination, type PaginationProps } from './Pagination.tsx';
9
9
  export { SearchBox, type SearchBoxProps } from './SearchBox.tsx';
10
10
  export { Modal, type ModalProps } from './Modal.tsx';
11
11
  export { Tabs, type TabsProps, type TabItem } from './Tabs.tsx';
12
+ export { Panel, type PanelProps } from './Panel.tsx';
13
+ export { PanelHeader, type PanelHeaderProps } from './PanelHeader.tsx';
14
+ export { ActionRow, type ActionRowProps } from './ActionRow.tsx';
15
+ export { FieldGroup, type FieldGroupProps } from './FieldGroup.tsx';
16
+ export { InlineStatus, type InlineStatusProps } from './InlineStatus.tsx';
@@ -128,6 +128,127 @@
128
128
  }
129
129
  }
130
130
 
131
+ // Panel
132
+ .ec-panel {
133
+ border: 1px solid var(--border-color, #ddd);
134
+ border-radius: var(--border-radius-lg, 8px);
135
+ padding: var(--spacing-md, 1rem);
136
+ background: var(--card-background, #f8f8f8);
137
+ display: grid;
138
+ gap: var(--spacing-md, 1rem);
139
+ }
140
+
141
+ .ec-panel--compact {
142
+ padding: var(--spacing-sm, 0.5rem) var(--spacing-md, 1rem);
143
+ border-radius: var(--border-radius-md, 6px);
144
+ }
145
+
146
+ // Panel Header
147
+ .ec-panel-header {
148
+ display: flex;
149
+ justify-content: space-between;
150
+ align-items: center;
151
+ gap: var(--spacing-md, 1rem);
152
+ flex-wrap: wrap;
153
+ padding-bottom: var(--spacing-md, 1rem);
154
+ border-bottom: 1px solid var(--border-color, #ddd);
155
+ }
156
+
157
+ .ec-panel-header__main {
158
+ display: grid;
159
+ gap: var(--spacing-xs, 0.25rem);
160
+ }
161
+
162
+ .ec-panel-header__title {
163
+ margin: 0;
164
+ font-family: var(--font-family-heading, inherit);
165
+ font-weight: 600;
166
+ color: var(--text-color, #111);
167
+ }
168
+
169
+ .ec-panel-header__description {
170
+ color: var(--muted-text, #666);
171
+ font-size: var(--font-size-sm, 0.875rem);
172
+ }
173
+
174
+ .ec-panel-header__actions {
175
+ display: flex;
176
+ align-items: center;
177
+ gap: var(--spacing-sm, 0.5rem);
178
+ flex-wrap: wrap;
179
+ }
180
+
181
+ // Action Row
182
+ .ec-action-row {
183
+ display: flex;
184
+ align-items: center;
185
+ gap: var(--spacing-sm, 0.5rem);
186
+ flex-wrap: wrap;
187
+ }
188
+
189
+ .ec-action-row--between {
190
+ justify-content: space-between;
191
+ }
192
+
193
+ .ec-action-row--end {
194
+ justify-content: flex-end;
195
+ }
196
+
197
+ // Field Group
198
+ .ec-field-group {
199
+ display: grid;
200
+ gap: var(--spacing-xs, 0.25rem);
201
+ margin-bottom: var(--spacing-md, 1rem);
202
+ }
203
+
204
+ .ec-field-group__label {
205
+ display: block;
206
+ font-weight: 600;
207
+ color: var(--text-color, #111);
208
+ font-size: var(--font-size-sm, 0.875rem);
209
+ }
210
+
211
+ .ec-field-group__required {
212
+ color: var(--error-color, #dc3232);
213
+ }
214
+
215
+ .ec-field-group__control {
216
+ display: grid;
217
+ gap: var(--spacing-xs, 0.25rem);
218
+ }
219
+
220
+ .ec-field-group__help {
221
+ font-size: var(--font-size-sm, 0.875rem);
222
+ color: var(--muted-text, #666);
223
+ }
224
+
225
+ .ec-field-group__error {
226
+ font-size: var(--font-size-sm, 0.875rem);
227
+ color: var(--error-color, #dc3232);
228
+ }
229
+
230
+ // Inline Status
231
+ .ec-inline-status {
232
+ font-size: var(--font-size-sm, 0.875rem);
233
+ font-weight: 500;
234
+ }
235
+
236
+ .ec-inline-status--success {
237
+ color: var(--success-color, #2e7d32);
238
+ }
239
+
240
+ .ec-inline-status--error {
241
+ color: var(--error-color, #dc3232);
242
+ }
243
+
244
+ .ec-inline-status--warning {
245
+ color: #856404;
246
+ }
247
+
248
+ .ec-inline-status--info {
249
+ color: #004085;
250
+ }
251
+
131
252
  // Badges (commonly used with tables)
132
253
  .ec-badge {
133
254
  display: inline-block;