@ggui-ai/dev-stack 0.7.0 → 0.9.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.
- package/dist/hub-preview/client.js +643 -713
- package/dist/local-registry/compile-ui.js +4 -4
- package/package.json +7 -7
|
@@ -63,26 +63,26 @@ var require_react_production = __commonJS({
|
|
|
63
63
|
};
|
|
64
64
|
var assign = Object.assign;
|
|
65
65
|
var emptyObject = {};
|
|
66
|
-
function
|
|
66
|
+
function Component(props, context, updater) {
|
|
67
67
|
this.props = props;
|
|
68
68
|
this.context = context;
|
|
69
69
|
this.refs = emptyObject;
|
|
70
70
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
71
71
|
}
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
Component.prototype.isReactComponent = {};
|
|
73
|
+
Component.prototype.setState = function(partialState, callback) {
|
|
74
74
|
if ("object" !== typeof partialState && "function" !== typeof partialState && null != partialState)
|
|
75
75
|
throw Error(
|
|
76
76
|
"takes an object of state variables to update or a function which returns an object of state variables."
|
|
77
77
|
);
|
|
78
78
|
this.updater.enqueueSetState(this, partialState, callback, "setState");
|
|
79
79
|
};
|
|
80
|
-
|
|
80
|
+
Component.prototype.forceUpdate = function(callback) {
|
|
81
81
|
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
82
82
|
};
|
|
83
83
|
function ComponentDummy() {
|
|
84
84
|
}
|
|
85
|
-
ComponentDummy.prototype =
|
|
85
|
+
ComponentDummy.prototype = Component.prototype;
|
|
86
86
|
function PureComponent(props, context, updater) {
|
|
87
87
|
this.props = props;
|
|
88
88
|
this.context = context;
|
|
@@ -91,7 +91,7 @@ var require_react_production = __commonJS({
|
|
|
91
91
|
}
|
|
92
92
|
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
93
93
|
pureComponentPrototype.constructor = PureComponent;
|
|
94
|
-
assign(pureComponentPrototype,
|
|
94
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
95
95
|
pureComponentPrototype.isPureReactComponent = true;
|
|
96
96
|
var isArrayImpl = Array.isArray;
|
|
97
97
|
function noop() {
|
|
@@ -296,7 +296,7 @@ var require_react_production = __commonJS({
|
|
|
296
296
|
};
|
|
297
297
|
exports.Activity = REACT_ACTIVITY_TYPE;
|
|
298
298
|
exports.Children = Children;
|
|
299
|
-
exports.Component =
|
|
299
|
+
exports.Component = Component;
|
|
300
300
|
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
301
301
|
exports.Profiler = REACT_PROFILER_TYPE;
|
|
302
302
|
exports.PureComponent = PureComponent;
|
|
@@ -2785,9 +2785,9 @@ var require_react_dom_client_production = __commonJS({
|
|
|
2785
2785
|
function createFiberImplClass(tag, pendingProps, key, mode) {
|
|
2786
2786
|
return new FiberNode(tag, pendingProps, key, mode);
|
|
2787
2787
|
}
|
|
2788
|
-
function shouldConstruct(
|
|
2789
|
-
|
|
2790
|
-
return !(!
|
|
2788
|
+
function shouldConstruct(Component) {
|
|
2789
|
+
Component = Component.prototype;
|
|
2790
|
+
return !(!Component || !Component.isReactComponent);
|
|
2791
2791
|
}
|
|
2792
2792
|
function createWorkInProgress(current, pendingProps) {
|
|
2793
2793
|
var workInProgress2 = current.alternate;
|
|
@@ -4157,7 +4157,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4157
4157
|
if (!objectIs(nextDeps[i], prevDeps[i])) return false;
|
|
4158
4158
|
return true;
|
|
4159
4159
|
}
|
|
4160
|
-
function renderWithHooks(current, workInProgress2,
|
|
4160
|
+
function renderWithHooks(current, workInProgress2, Component, props, secondArg, nextRenderLanes) {
|
|
4161
4161
|
renderLanes = nextRenderLanes;
|
|
4162
4162
|
currentlyRenderingFiber = workInProgress2;
|
|
4163
4163
|
workInProgress2.memoizedState = null;
|
|
@@ -4165,11 +4165,11 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4165
4165
|
workInProgress2.lanes = 0;
|
|
4166
4166
|
ReactSharedInternals.H = null === current || null === current.memoizedState ? HooksDispatcherOnMount : HooksDispatcherOnUpdate;
|
|
4167
4167
|
shouldDoubleInvokeUserFnsInHooksDEV = false;
|
|
4168
|
-
nextRenderLanes =
|
|
4168
|
+
nextRenderLanes = Component(props, secondArg);
|
|
4169
4169
|
shouldDoubleInvokeUserFnsInHooksDEV = false;
|
|
4170
4170
|
didScheduleRenderPhaseUpdateDuringThisPass && (nextRenderLanes = renderWithHooksAgain(
|
|
4171
4171
|
workInProgress2,
|
|
4172
|
-
|
|
4172
|
+
Component,
|
|
4173
4173
|
props,
|
|
4174
4174
|
secondArg
|
|
4175
4175
|
));
|
|
@@ -4187,7 +4187,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4187
4187
|
if (didRenderTooFewHooks) throw Error(formatProdErrorMessage(300));
|
|
4188
4188
|
null === current || didReceiveUpdate || (current = current.dependencies, null !== current && checkIfContextChanged(current) && (didReceiveUpdate = true));
|
|
4189
4189
|
}
|
|
4190
|
-
function renderWithHooksAgain(workInProgress2,
|
|
4190
|
+
function renderWithHooksAgain(workInProgress2, Component, props, secondArg) {
|
|
4191
4191
|
currentlyRenderingFiber = workInProgress2;
|
|
4192
4192
|
var numberOfReRenders = 0;
|
|
4193
4193
|
do {
|
|
@@ -4205,7 +4205,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
4205
4205
|
null != children.memoCache && (children.memoCache.index = 0);
|
|
4206
4206
|
}
|
|
4207
4207
|
ReactSharedInternals.H = HooksDispatcherOnRerender;
|
|
4208
|
-
children =
|
|
4208
|
+
children = Component(props, secondArg);
|
|
4209
4209
|
} while (didScheduleRenderPhaseUpdateDuringThisPass);
|
|
4210
4210
|
return children;
|
|
4211
4211
|
}
|
|
@@ -5406,17 +5406,17 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5406
5406
|
"function" === typeof instance.UNSAFE_componentWillReceiveProps && instance.UNSAFE_componentWillReceiveProps(newProps, nextContext);
|
|
5407
5407
|
instance.state !== workInProgress2 && classComponentUpdater.enqueueReplaceState(instance, instance.state, null);
|
|
5408
5408
|
}
|
|
5409
|
-
function resolveClassComponentProps(
|
|
5409
|
+
function resolveClassComponentProps(Component, baseProps) {
|
|
5410
5410
|
var newProps = baseProps;
|
|
5411
5411
|
if ("ref" in baseProps) {
|
|
5412
5412
|
newProps = {};
|
|
5413
5413
|
for (var propName in baseProps)
|
|
5414
5414
|
"ref" !== propName && (newProps[propName] = baseProps[propName]);
|
|
5415
5415
|
}
|
|
5416
|
-
if (
|
|
5416
|
+
if (Component = Component.defaultProps) {
|
|
5417
5417
|
newProps === baseProps && (newProps = assign({}, newProps));
|
|
5418
|
-
for (var propName$73 in
|
|
5419
|
-
void 0 === newProps[propName$73] && (newProps[propName$73] =
|
|
5418
|
+
for (var propName$73 in Component)
|
|
5419
|
+
void 0 === newProps[propName$73] && (newProps[propName$73] = Component[propName$73]);
|
|
5420
5420
|
}
|
|
5421
5421
|
return newProps;
|
|
5422
5422
|
}
|
|
@@ -5560,8 +5560,8 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5560
5560
|
renderLanes2
|
|
5561
5561
|
);
|
|
5562
5562
|
}
|
|
5563
|
-
function updateForwardRef(current, workInProgress2,
|
|
5564
|
-
|
|
5563
|
+
function updateForwardRef(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5564
|
+
Component = Component.render;
|
|
5565
5565
|
var ref = workInProgress2.ref;
|
|
5566
5566
|
if ("ref" in nextProps) {
|
|
5567
5567
|
var propsWithoutRef = {};
|
|
@@ -5572,7 +5572,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5572
5572
|
nextProps = renderWithHooks(
|
|
5573
5573
|
current,
|
|
5574
5574
|
workInProgress2,
|
|
5575
|
-
|
|
5575
|
+
Component,
|
|
5576
5576
|
propsWithoutRef,
|
|
5577
5577
|
ref,
|
|
5578
5578
|
renderLanes2
|
|
@@ -5585,10 +5585,10 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5585
5585
|
reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
|
|
5586
5586
|
return workInProgress2.child;
|
|
5587
5587
|
}
|
|
5588
|
-
function updateMemoComponent(current, workInProgress2,
|
|
5588
|
+
function updateMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5589
5589
|
if (null === current) {
|
|
5590
|
-
var type =
|
|
5591
|
-
if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null ===
|
|
5590
|
+
var type = Component.type;
|
|
5591
|
+
if ("function" === typeof type && !shouldConstruct(type) && void 0 === type.defaultProps && null === Component.compare)
|
|
5592
5592
|
return workInProgress2.tag = 15, workInProgress2.type = type, updateSimpleMemoComponent(
|
|
5593
5593
|
current,
|
|
5594
5594
|
workInProgress2,
|
|
@@ -5597,7 +5597,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5597
5597
|
renderLanes2
|
|
5598
5598
|
);
|
|
5599
5599
|
current = createFiberFromTypeAndProps(
|
|
5600
|
-
|
|
5600
|
+
Component.type,
|
|
5601
5601
|
null,
|
|
5602
5602
|
nextProps,
|
|
5603
5603
|
workInProgress2,
|
|
@@ -5611,9 +5611,9 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5611
5611
|
type = current.child;
|
|
5612
5612
|
if (!checkScheduledUpdateOrContext(current, renderLanes2)) {
|
|
5613
5613
|
var prevProps = type.memoizedProps;
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
if (
|
|
5614
|
+
Component = Component.compare;
|
|
5615
|
+
Component = null !== Component ? Component : shallowEqual;
|
|
5616
|
+
if (Component(prevProps, nextProps) && current.ref === workInProgress2.ref)
|
|
5617
5617
|
return bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
|
|
5618
5618
|
}
|
|
5619
5619
|
workInProgress2.flags |= 1;
|
|
@@ -5622,7 +5622,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5622
5622
|
current.return = workInProgress2;
|
|
5623
5623
|
return workInProgress2.child = current;
|
|
5624
5624
|
}
|
|
5625
|
-
function updateSimpleMemoComponent(current, workInProgress2,
|
|
5625
|
+
function updateSimpleMemoComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5626
5626
|
if (null !== current) {
|
|
5627
5627
|
var prevProps = current.memoizedProps;
|
|
5628
5628
|
if (shallowEqual(prevProps, nextProps) && current.ref === workInProgress2.ref)
|
|
@@ -5634,7 +5634,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5634
5634
|
return updateFunctionComponent(
|
|
5635
5635
|
current,
|
|
5636
5636
|
workInProgress2,
|
|
5637
|
-
|
|
5637
|
+
Component,
|
|
5638
5638
|
nextProps,
|
|
5639
5639
|
renderLanes2
|
|
5640
5640
|
);
|
|
@@ -5794,12 +5794,12 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5794
5794
|
workInProgress2.flags |= 4194816;
|
|
5795
5795
|
}
|
|
5796
5796
|
}
|
|
5797
|
-
function updateFunctionComponent(current, workInProgress2,
|
|
5797
|
+
function updateFunctionComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5798
5798
|
prepareToReadContext(workInProgress2);
|
|
5799
|
-
|
|
5799
|
+
Component = renderWithHooks(
|
|
5800
5800
|
current,
|
|
5801
5801
|
workInProgress2,
|
|
5802
|
-
|
|
5802
|
+
Component,
|
|
5803
5803
|
nextProps,
|
|
5804
5804
|
void 0,
|
|
5805
5805
|
renderLanes2
|
|
@@ -5809,33 +5809,33 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5809
5809
|
return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
|
|
5810
5810
|
isHydrating && nextProps && pushMaterializedTreeId(workInProgress2);
|
|
5811
5811
|
workInProgress2.flags |= 1;
|
|
5812
|
-
reconcileChildren(current, workInProgress2,
|
|
5812
|
+
reconcileChildren(current, workInProgress2, Component, renderLanes2);
|
|
5813
5813
|
return workInProgress2.child;
|
|
5814
5814
|
}
|
|
5815
|
-
function replayFunctionComponent(current, workInProgress2, nextProps,
|
|
5815
|
+
function replayFunctionComponent(current, workInProgress2, nextProps, Component, secondArg, renderLanes2) {
|
|
5816
5816
|
prepareToReadContext(workInProgress2);
|
|
5817
5817
|
workInProgress2.updateQueue = null;
|
|
5818
5818
|
nextProps = renderWithHooksAgain(
|
|
5819
5819
|
workInProgress2,
|
|
5820
|
-
|
|
5820
|
+
Component,
|
|
5821
5821
|
nextProps,
|
|
5822
5822
|
secondArg
|
|
5823
5823
|
);
|
|
5824
5824
|
finishRenderingHooks(current);
|
|
5825
|
-
|
|
5825
|
+
Component = checkDidRenderIdHook();
|
|
5826
5826
|
if (null !== current && !didReceiveUpdate)
|
|
5827
5827
|
return bailoutHooks(current, workInProgress2, renderLanes2), bailoutOnAlreadyFinishedWork(current, workInProgress2, renderLanes2);
|
|
5828
|
-
isHydrating &&
|
|
5828
|
+
isHydrating && Component && pushMaterializedTreeId(workInProgress2);
|
|
5829
5829
|
workInProgress2.flags |= 1;
|
|
5830
5830
|
reconcileChildren(current, workInProgress2, nextProps, renderLanes2);
|
|
5831
5831
|
return workInProgress2.child;
|
|
5832
5832
|
}
|
|
5833
|
-
function updateClassComponent(current, workInProgress2,
|
|
5833
|
+
function updateClassComponent(current, workInProgress2, Component, nextProps, renderLanes2) {
|
|
5834
5834
|
prepareToReadContext(workInProgress2);
|
|
5835
5835
|
if (null === workInProgress2.stateNode) {
|
|
5836
|
-
var context = emptyContextObject, contextType =
|
|
5836
|
+
var context = emptyContextObject, contextType = Component.contextType;
|
|
5837
5837
|
"object" === typeof contextType && null !== contextType && (context = readContext(contextType));
|
|
5838
|
-
context = new
|
|
5838
|
+
context = new Component(nextProps, context);
|
|
5839
5839
|
workInProgress2.memoizedState = null !== context.state && void 0 !== context.state ? context.state : null;
|
|
5840
5840
|
context.updater = classComponentUpdater;
|
|
5841
5841
|
workInProgress2.stateNode = context;
|
|
@@ -5845,27 +5845,27 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5845
5845
|
context.state = workInProgress2.memoizedState;
|
|
5846
5846
|
context.refs = {};
|
|
5847
5847
|
initializeUpdateQueue(workInProgress2);
|
|
5848
|
-
contextType =
|
|
5848
|
+
contextType = Component.contextType;
|
|
5849
5849
|
context.context = "object" === typeof contextType && null !== contextType ? readContext(contextType) : emptyContextObject;
|
|
5850
5850
|
context.state = workInProgress2.memoizedState;
|
|
5851
|
-
contextType =
|
|
5851
|
+
contextType = Component.getDerivedStateFromProps;
|
|
5852
5852
|
"function" === typeof contextType && (applyDerivedStateFromProps(
|
|
5853
5853
|
workInProgress2,
|
|
5854
|
-
|
|
5854
|
+
Component,
|
|
5855
5855
|
contextType,
|
|
5856
5856
|
nextProps
|
|
5857
5857
|
), context.state = workInProgress2.memoizedState);
|
|
5858
|
-
"function" === typeof
|
|
5858
|
+
"function" === typeof Component.getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate || "function" !== typeof context.UNSAFE_componentWillMount && "function" !== typeof context.componentWillMount || (contextType = context.state, "function" === typeof context.componentWillMount && context.componentWillMount(), "function" === typeof context.UNSAFE_componentWillMount && context.UNSAFE_componentWillMount(), contextType !== context.state && classComponentUpdater.enqueueReplaceState(context, context.state, null), processUpdateQueue(workInProgress2, nextProps, context, renderLanes2), suspendIfUpdateReadFromEntangledAsyncAction(), context.state = workInProgress2.memoizedState);
|
|
5859
5859
|
"function" === typeof context.componentDidMount && (workInProgress2.flags |= 4194308);
|
|
5860
5860
|
nextProps = true;
|
|
5861
5861
|
} else if (null === current) {
|
|
5862
5862
|
context = workInProgress2.stateNode;
|
|
5863
|
-
var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(
|
|
5863
|
+
var unresolvedOldProps = workInProgress2.memoizedProps, oldProps = resolveClassComponentProps(Component, unresolvedOldProps);
|
|
5864
5864
|
context.props = oldProps;
|
|
5865
|
-
var oldContext = context.context, contextType$jscomp$0 =
|
|
5865
|
+
var oldContext = context.context, contextType$jscomp$0 = Component.contextType;
|
|
5866
5866
|
contextType = emptyContextObject;
|
|
5867
5867
|
"object" === typeof contextType$jscomp$0 && null !== contextType$jscomp$0 && (contextType = readContext(contextType$jscomp$0));
|
|
5868
|
-
var getDerivedStateFromProps =
|
|
5868
|
+
var getDerivedStateFromProps = Component.getDerivedStateFromProps;
|
|
5869
5869
|
contextType$jscomp$0 = "function" === typeof getDerivedStateFromProps || "function" === typeof context.getSnapshotBeforeUpdate;
|
|
5870
5870
|
unresolvedOldProps = workInProgress2.pendingProps !== unresolvedOldProps;
|
|
5871
5871
|
contextType$jscomp$0 || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (unresolvedOldProps || oldContext !== contextType) && callComponentWillReceiveProps(
|
|
@@ -5882,12 +5882,12 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5882
5882
|
oldContext = workInProgress2.memoizedState;
|
|
5883
5883
|
unresolvedOldProps || oldState !== oldContext || hasForceUpdate ? ("function" === typeof getDerivedStateFromProps && (applyDerivedStateFromProps(
|
|
5884
5884
|
workInProgress2,
|
|
5885
|
-
|
|
5885
|
+
Component,
|
|
5886
5886
|
getDerivedStateFromProps,
|
|
5887
5887
|
nextProps
|
|
5888
5888
|
), oldContext = workInProgress2.memoizedState), (oldProps = hasForceUpdate || checkShouldComponentUpdate(
|
|
5889
5889
|
workInProgress2,
|
|
5890
|
-
|
|
5890
|
+
Component,
|
|
5891
5891
|
oldProps,
|
|
5892
5892
|
nextProps,
|
|
5893
5893
|
oldState,
|
|
@@ -5898,14 +5898,14 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5898
5898
|
context = workInProgress2.stateNode;
|
|
5899
5899
|
cloneUpdateQueue(current, workInProgress2);
|
|
5900
5900
|
contextType = workInProgress2.memoizedProps;
|
|
5901
|
-
contextType$jscomp$0 = resolveClassComponentProps(
|
|
5901
|
+
contextType$jscomp$0 = resolveClassComponentProps(Component, contextType);
|
|
5902
5902
|
context.props = contextType$jscomp$0;
|
|
5903
5903
|
getDerivedStateFromProps = workInProgress2.pendingProps;
|
|
5904
5904
|
oldState = context.context;
|
|
5905
|
-
oldContext =
|
|
5905
|
+
oldContext = Component.contextType;
|
|
5906
5906
|
oldProps = emptyContextObject;
|
|
5907
5907
|
"object" === typeof oldContext && null !== oldContext && (oldProps = readContext(oldContext));
|
|
5908
|
-
unresolvedOldProps =
|
|
5908
|
+
unresolvedOldProps = Component.getDerivedStateFromProps;
|
|
5909
5909
|
(oldContext = "function" === typeof unresolvedOldProps || "function" === typeof context.getSnapshotBeforeUpdate) || "function" !== typeof context.UNSAFE_componentWillReceiveProps && "function" !== typeof context.componentWillReceiveProps || (contextType !== getDerivedStateFromProps || oldState !== oldProps) && callComponentWillReceiveProps(
|
|
5910
5910
|
workInProgress2,
|
|
5911
5911
|
context,
|
|
@@ -5920,12 +5920,12 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5920
5920
|
var newState = workInProgress2.memoizedState;
|
|
5921
5921
|
contextType !== getDerivedStateFromProps || oldState !== newState || hasForceUpdate || null !== current && null !== current.dependencies && checkIfContextChanged(current.dependencies) ? ("function" === typeof unresolvedOldProps && (applyDerivedStateFromProps(
|
|
5922
5922
|
workInProgress2,
|
|
5923
|
-
|
|
5923
|
+
Component,
|
|
5924
5924
|
unresolvedOldProps,
|
|
5925
5925
|
nextProps
|
|
5926
5926
|
), newState = workInProgress2.memoizedState), (contextType$jscomp$0 = hasForceUpdate || checkShouldComponentUpdate(
|
|
5927
5927
|
workInProgress2,
|
|
5928
|
-
|
|
5928
|
+
Component,
|
|
5929
5929
|
contextType$jscomp$0,
|
|
5930
5930
|
nextProps,
|
|
5931
5931
|
oldState,
|
|
@@ -5940,7 +5940,7 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5940
5940
|
context = nextProps;
|
|
5941
5941
|
markRef(current, workInProgress2);
|
|
5942
5942
|
nextProps = 0 !== (workInProgress2.flags & 128);
|
|
5943
|
-
context || nextProps ? (context = workInProgress2.stateNode,
|
|
5943
|
+
context || nextProps ? (context = workInProgress2.stateNode, Component = nextProps && "function" !== typeof Component.getDerivedStateFromError ? null : context.render(), workInProgress2.flags |= 1, null !== current && nextProps ? (workInProgress2.child = reconcileChildFibers(
|
|
5944
5944
|
workInProgress2,
|
|
5945
5945
|
current.child,
|
|
5946
5946
|
null,
|
|
@@ -5948,9 +5948,9 @@ var require_react_dom_client_production = __commonJS({
|
|
|
5948
5948
|
), workInProgress2.child = reconcileChildFibers(
|
|
5949
5949
|
workInProgress2,
|
|
5950
5950
|
null,
|
|
5951
|
-
|
|
5951
|
+
Component,
|
|
5952
5952
|
renderLanes2
|
|
5953
|
-
)) : reconcileChildren(current, workInProgress2,
|
|
5953
|
+
)) : reconcileChildren(current, workInProgress2, Component, renderLanes2), workInProgress2.memoizedState = context.state, current = workInProgress2.child) : current = bailoutOnAlreadyFinishedWork(
|
|
5954
5954
|
current,
|
|
5955
5955
|
workInProgress2,
|
|
5956
5956
|
renderLanes2
|
|
@@ -19674,12 +19674,15 @@ var require_jsx_runtime = __commonJS({
|
|
|
19674
19674
|
});
|
|
19675
19675
|
|
|
19676
19676
|
// hub-preview-client/main.tsx
|
|
19677
|
-
var
|
|
19677
|
+
var import_react43 = __toESM(require_react(), 1);
|
|
19678
19678
|
var import_client = __toESM(require_client(), 1);
|
|
19679
19679
|
|
|
19680
|
-
// ../
|
|
19681
|
-
var
|
|
19682
|
-
var
|
|
19680
|
+
// ../mcp-apps-react/dist/chunk-7P6ASYW6.mjs
|
|
19681
|
+
var __defProp2 = Object.defineProperty;
|
|
19682
|
+
var __export2 = (target, all) => {
|
|
19683
|
+
for (var name in all)
|
|
19684
|
+
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
19685
|
+
};
|
|
19683
19686
|
|
|
19684
19687
|
// ../protocol/dist/version.js
|
|
19685
19688
|
var PROTOCOL_VERSION = "draft-2026-06-12";
|
|
@@ -34209,7 +34212,7 @@ config(en_default());
|
|
|
34209
34212
|
|
|
34210
34213
|
// ../protocol/dist/gadgets/stdlib-gadgets.js
|
|
34211
34214
|
var STDLIB_GADGETS_PACKAGE = "@ggui-ai/gadgets";
|
|
34212
|
-
var STDLIB_GADGETS_VERSION = "0.
|
|
34215
|
+
var STDLIB_GADGETS_VERSION = "0.9.0";
|
|
34213
34216
|
var STDLIB_GADGETS = [
|
|
34214
34217
|
{
|
|
34215
34218
|
package: STDLIB_GADGETS_PACKAGE,
|
|
@@ -34696,7 +34699,13 @@ var listFeaturedBlueprintsInputShape = {};
|
|
|
34696
34699
|
var listFeaturedBlueprintsInputSchema = external_exports.object(listFeaturedBlueprintsInputShape);
|
|
34697
34700
|
var searchBlueprintsInputShape = {
|
|
34698
34701
|
query: external_exports.string().min(1).describe("Natural-language description of the UI you're looking for"),
|
|
34699
|
-
limit: external_exports.number().int().min(1).max(100).optional()
|
|
34702
|
+
limit: external_exports.number().int().min(1).max(100).optional(),
|
|
34703
|
+
// Charset mirrors `MCP_TOOL_BINDING_NAME_RE` in
|
|
34704
|
+
// `@ggui-ai/artifact-manifest` (src/mcp-tool-bindings.ts). Inlined:
|
|
34705
|
+
// protocol cannot import artifact-manifest — the dependency points
|
|
34706
|
+
// the other way.
|
|
34707
|
+
tool: external_exports.string().regex(/^[A-Za-z0-9_.-]{1,128}$/).optional().describe("Filter registry-sourced candidates to artifacts declaring a binding for this exact MCP tool name (case-sensitive). Local results are unaffected."),
|
|
34708
|
+
server: external_exports.string().regex(/^[A-Za-z0-9_.-]{1,128}$/).optional().describe("Filter registry-sourced candidates to artifacts declaring a binding for this exact MCP server name (case-sensitive). Combine with `tool` to require the exact (server, tool) pair.")
|
|
34700
34709
|
};
|
|
34701
34710
|
var searchBlueprintsInputSchema = external_exports.object(searchBlueprintsInputShape);
|
|
34702
34711
|
var renderBlueprintInputShape = {
|
|
@@ -34820,10 +34829,11 @@ var renderErrorCodeSchema = external_exports.enum([
|
|
|
34820
34829
|
"PRODUCTION_FAILED",
|
|
34821
34830
|
"VALIDATION_ERROR",
|
|
34822
34831
|
"NO_PLATFORM_KEY",
|
|
34823
|
-
"NO_CREDENTIALS"
|
|
34832
|
+
"NO_CREDENTIALS",
|
|
34833
|
+
"GENERATION_QUEUE_OVERLOADED"
|
|
34824
34834
|
]);
|
|
34825
34835
|
var renderErrorSchema = external_exports.object({
|
|
34826
|
-
code: renderErrorCodeSchema.describe("Canonical failure class. PRODUCTION_FAILED: generation did not produce a component. VALIDATION_ERROR: a server-side precondition rejected the render before generation. NO_PLATFORM_KEY: the server's managed provider-key configuration has no key for the resolved route. NO_CREDENTIALS: no generation credentials are configured on the server."),
|
|
34836
|
+
code: renderErrorCodeSchema.describe("Canonical failure class. PRODUCTION_FAILED: generation did not produce a component. VALIDATION_ERROR: a server-side precondition rejected the render before generation. NO_PLATFORM_KEY: the server's managed provider-key configuration has no key for the resolved route. NO_CREDENTIALS: no generation credentials are configured on the server. GENERATION_QUEUE_OVERLOADED: the deployment's admission gate rejected the request before generation started (queue full or wait timed out) \u2014 not a failed attempt; safe to retry immediately."),
|
|
34827
34837
|
message: external_exports.string().describe("Human-readable failure detail \u2014 fold into the next attempt or surface to the operator.")
|
|
34828
34838
|
});
|
|
34829
34839
|
var resourceReadErrorCodeSchema = external_exports.enum([
|
|
@@ -34881,33 +34891,78 @@ var renderOutputSchema = external_exports.object({
|
|
|
34881
34891
|
description: external_exports.string(),
|
|
34882
34892
|
example: external_exports.string(),
|
|
34883
34893
|
args: external_exports.object({
|
|
34884
|
-
sessionId: external_exports.string()
|
|
34894
|
+
sessionId: external_exports.string(),
|
|
34895
|
+
// The per-call long-poll window in seconds. Carried on the hint
|
|
34896
|
+
// because consume's own default is 0 (single non-blocking
|
|
34897
|
+
// drain): an agent copying a timeout-less hint gets an instant
|
|
34898
|
+
// empty result and stops looping.
|
|
34899
|
+
timeout: external_exports.number()
|
|
34885
34900
|
})
|
|
34886
|
-
}).optional().describe("
|
|
34901
|
+
}).optional().describe("Required-next-call hint \u2014 when the rendered contract has actions, points the agent at ggui_consume({sessionId, timeout}) for the inbound action loop. Absent for pure-display renders.")
|
|
34887
34902
|
});
|
|
34888
34903
|
var updateInputSchema = external_exports.discriminatedUnion("kind", [
|
|
34889
34904
|
external_exports.object({
|
|
34890
34905
|
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34891
34906
|
kind: external_exports.literal("replace"),
|
|
34892
|
-
props: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Full replacement props map. New map IS the new state.")
|
|
34907
|
+
props: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Full replacement props map. New map IS the new state, rendered as a NEW card (a new history entry). For an in-place repaint of the mounted card use ggui_amend.")
|
|
34908
|
+
}).strict(),
|
|
34909
|
+
external_exports.object({
|
|
34910
|
+
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34911
|
+
kind: external_exports.literal("merge"),
|
|
34912
|
+
patch: external_exports.record(external_exports.string(), external_exports.unknown()).describe("RFC 7396 JSON Merge Patch \u2014 null deletes a key; arrays fully replace. The merged state renders as a NEW card (a new history entry). For an in-place repaint of the mounted card use ggui_amend.")
|
|
34913
|
+
}).strict()
|
|
34914
|
+
]);
|
|
34915
|
+
var amendInputSchema = external_exports.discriminatedUnion("kind", [
|
|
34916
|
+
external_exports.object({
|
|
34917
|
+
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34918
|
+
kind: external_exports.literal("replace"),
|
|
34919
|
+
props: external_exports.record(external_exports.string(), external_exports.unknown()).describe("Full replacement props map, applied to the currently mounted card in place.")
|
|
34893
34920
|
}).strict(),
|
|
34894
34921
|
external_exports.object({
|
|
34895
34922
|
sessionId: external_exports.string().describe("GguiSession opaque id (UUID) \u2014 returned by ggui_render."),
|
|
34896
34923
|
kind: external_exports.literal("merge"),
|
|
34897
|
-
patch: external_exports.record(external_exports.string(), external_exports.unknown()).describe("RFC 7396 JSON Merge Patch \u2014 null deletes a key; arrays fully replace.")
|
|
34924
|
+
patch: external_exports.record(external_exports.string(), external_exports.unknown()).describe("RFC 7396 JSON Merge Patch \u2014 null deletes a key; arrays fully replace. Applied to the currently mounted card in place.")
|
|
34898
34925
|
}).strict()
|
|
34899
34926
|
]);
|
|
34900
34927
|
var updateOutputSchema = external_exports.object({
|
|
34901
34928
|
sessionId: external_exports.string(),
|
|
34902
34929
|
updated: external_exports.boolean(),
|
|
34903
34930
|
/**
|
|
34904
|
-
*
|
|
34905
|
-
*
|
|
34906
|
-
*
|
|
34931
|
+
* The epoch-pinned URI of the NEW history record this update minted
|
|
34932
|
+
* (`ui://ggui/render/{id}[/{key}]#{epoch}` — see epoch-uri.ts). On a
|
|
34933
|
+
* no-op (`updated: false`) no record is minted and this is the bare
|
|
34934
|
+
* live-head URI. Mirrored on the LLM-visible structuredContent so
|
|
34935
|
+
* SDKs that strip `_meta` from tool_results can still reach the
|
|
34907
34936
|
* mount URI. Kept in sync with the update handler's wire shape —
|
|
34908
34937
|
* this export and the handler's inline schema must not drift.
|
|
34909
34938
|
*/
|
|
34910
|
-
resourceUri: external_exports.string()
|
|
34939
|
+
resourceUri: external_exports.string(),
|
|
34940
|
+
/**
|
|
34941
|
+
* The session's head epoch after this call: advanced by one on a
|
|
34942
|
+
* real update (`updated: true`), unchanged on a no-op. `ggui_render`
|
|
34943
|
+
* mints epoch 0. The session ROW is the authority
|
|
34944
|
+
* (`GguiSessionBase.epoch`, absent ⇒ 0); the ledger's `ui.reminted`
|
|
34945
|
+
* events are the wire signal only — the ledger is horizon-bounded
|
|
34946
|
+
* and must never be counted as the source of truth.
|
|
34947
|
+
*/
|
|
34948
|
+
epoch: external_exports.number().int().min(0),
|
|
34949
|
+
/**
|
|
34950
|
+
* Present ONLY on a no-op (`updated: false`): the patch conformed to
|
|
34951
|
+
* the contract but left the final props semantically identical to
|
|
34952
|
+
* the current state, so nothing was written, nothing changes on
|
|
34953
|
+
* screen, and NO new history record was minted. Model-visible by
|
|
34954
|
+
* design — the common producer of a no-op is an agent echoing
|
|
34955
|
+
* existing props back believing it changed the UI, and this field is
|
|
34956
|
+
* its feedback channel.
|
|
34957
|
+
*/
|
|
34958
|
+
warning: external_exports.string().optional()
|
|
34959
|
+
});
|
|
34960
|
+
var amendOutputSchema = external_exports.object({
|
|
34961
|
+
sessionId: external_exports.string(),
|
|
34962
|
+
updated: external_exports.boolean(),
|
|
34963
|
+
resourceUri: external_exports.string(),
|
|
34964
|
+
/** Same no-op feedback channel as ggui_update's `warning`. */
|
|
34965
|
+
warning: external_exports.string().optional()
|
|
34911
34966
|
});
|
|
34912
34967
|
var declareToolCatalogInputSchema = external_exports.object({
|
|
34913
34968
|
toolCatalog: external_exports.record(external_exports.string(), external_exports.object({ name: external_exports.string(), version: external_exports.string().optional() }).strict()).describe("Per-app canonical tool identities: bare tool name -> its server's initialize-declared serverInfo. Host/library-supplied; not an agent action.")
|
|
@@ -34916,6 +34971,45 @@ var declareToolCatalogOutputSchema = external_exports.object({
|
|
|
34916
34971
|
saved: external_exports.boolean(),
|
|
34917
34972
|
appId: external_exports.string()
|
|
34918
34973
|
}).strict();
|
|
34974
|
+
var RUNTIME_PULL_MAX_LIMIT = 100;
|
|
34975
|
+
var RUNTIME_PULL_MAX_WAIT_SECONDS = 20;
|
|
34976
|
+
var gguiSessionEventSchema = external_exports.object({
|
|
34977
|
+
seq: external_exports.number().int().min(1).describe('Monotonic, gap-free per render; starts at 1 (0 is the "no events yet" cursor sentinel, never an event).'),
|
|
34978
|
+
type: external_exports.string().min(1).describe("Wire-frame type \u2014 see the canonical GguiSessionEventType taxonomy; plain string so servers can mint new types without a protocol bump."),
|
|
34979
|
+
timestamp: external_exports.string().describe("ISO 8601 UTC timestamp the server stamped on emission."),
|
|
34980
|
+
data: external_exports.unknown().describe("Type-specific payload \u2014 structurally identical to the matching live-channel frame payload.")
|
|
34981
|
+
});
|
|
34982
|
+
var runtimePullInputShape = {
|
|
34983
|
+
sessionId: external_exports.string().min(1).describe('Active render id \u2014 sourced from `_meta["ai.ggui/render"].sessionId` on the iframe boot envelope. Unknown and cross-tenant ids surface uniformly as session_not_found.'),
|
|
34984
|
+
sinceSequence: external_exports.number().int().min(0).optional().describe("Replay cursor \u2014 only events with seq > sinceSequence return. Omit (= 0) on first pull; advance to the last event's seq (or lastSequence on an empty page) on every subsequent pull."),
|
|
34985
|
+
limit: external_exports.number().int().min(1).optional().describe(`Max events per page. Values above ${RUNTIME_PULL_MAX_LIMIT} are clamped to ${RUNTIME_PULL_MAX_LIMIT}; omit for the default ${RUNTIME_PULL_MAX_LIMIT}. When hasMore is true, immediately re-pull with the advanced cursor.`),
|
|
34986
|
+
wait: external_exports.number().min(0).optional().describe(`Subscription-mode hold, in seconds. When set and the cursor page is empty, the server holds this call until an event lands or the hold elapses (values above ${RUNTIME_PULL_MAX_WAIT_SECONDS} are clamped to ${RUNTIME_PULL_MAX_WAIT_SECONDS}). An empty page after a full hold is a NORMAL result \u2014 immediately re-pull to stay subscribed, or back off to sparse un-held pulls after a few consecutive empties. Omit (= 0) for an immediate return.`)
|
|
34987
|
+
};
|
|
34988
|
+
var runtimePullInputSchema = external_exports.object(runtimePullInputShape);
|
|
34989
|
+
var runtimePullEventsPageSchema = external_exports.object({
|
|
34990
|
+
events: external_exports.array(gguiSessionEventSchema),
|
|
34991
|
+
lastSequence: external_exports.number().int().min(0),
|
|
34992
|
+
hasMore: external_exports.boolean()
|
|
34993
|
+
});
|
|
34994
|
+
var runtimePullHorizonSchema = external_exports.object({
|
|
34995
|
+
reason: external_exports.literal("REPLAY_HORIZON_PASSED"),
|
|
34996
|
+
currentSequence: external_exports.number().int().min(0)
|
|
34997
|
+
});
|
|
34998
|
+
var runtimePullOutputSchema = external_exports.union([
|
|
34999
|
+
runtimePullEventsPageSchema,
|
|
35000
|
+
runtimePullHorizonSchema
|
|
35001
|
+
]);
|
|
35002
|
+
var RUNTIME_TELEMETRY_MAX_EVENTS = 40;
|
|
35003
|
+
var runtimeTelemetryInputShape = {
|
|
35004
|
+
sessionId: external_exports.string().min(1).describe("Render id the report concerns \u2014 sourced from the boot envelope. Client-claimed: used as a log tag only."),
|
|
35005
|
+
events: external_exports.array(external_exports.object({
|
|
35006
|
+
at: external_exports.number().min(0).describe("Milliseconds since iframe boot (monotonic, client clock)."),
|
|
35007
|
+
kind: external_exports.string().min(1).max(64).describe("Event name \u2014 e.g. 'boot.path', 'status.connected', 'channel_failover_swap', 'doorbell.ring'."),
|
|
35008
|
+
detail: external_exports.string().max(512).optional().describe("Optional compact context (JSON fragment or message).")
|
|
35009
|
+
})).min(1).max(RUNTIME_TELEMETRY_MAX_EVENTS).describe("Batched ladder/doorbell events, oldest first.")
|
|
35010
|
+
};
|
|
35011
|
+
var runtimeTelemetryInputSchema = external_exports.object(runtimeTelemetryInputShape);
|
|
35012
|
+
var runtimeTelemetryOutputSchema = external_exports.object({ ok: external_exports.literal(true) });
|
|
34919
35013
|
|
|
34920
35014
|
// ../protocol/dist/schemas/invoke.js
|
|
34921
35015
|
var textBlockSchema = external_exports.object({
|
|
@@ -35553,24 +35647,10 @@ function validateActionEnvelope(envelope, spec, precompiledActions) {
|
|
|
35553
35647
|
return validateActionData(envelope.payload, spec, precompiledActions);
|
|
35554
35648
|
}
|
|
35555
35649
|
|
|
35556
|
-
// ../
|
|
35557
|
-
var
|
|
35558
|
-
var
|
|
35559
|
-
var
|
|
35560
|
-
var KNOWN_PERMISSION_NAMES_SET2 = new Set(KNOWN_PERMISSION_NAMES);
|
|
35561
|
-
var DECODER = new TextDecoder();
|
|
35562
|
-
|
|
35563
|
-
// ../ggui-react/dist/chunk-7P6ASYW6.mjs
|
|
35564
|
-
var __defProp2 = Object.defineProperty;
|
|
35565
|
-
var __export2 = (target, all) => {
|
|
35566
|
-
for (var name in all)
|
|
35567
|
-
__defProp2(target, name, { get: all[name], enumerable: true });
|
|
35568
|
-
};
|
|
35569
|
-
|
|
35570
|
-
// ../ggui-react/dist/index.mjs
|
|
35571
|
-
var import_react8 = __toESM(require_react(), 1);
|
|
35572
|
-
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
35573
|
-
var import_react9 = __toESM(require_react(), 1);
|
|
35650
|
+
// ../mcp-apps-react/dist/index.mjs
|
|
35651
|
+
var import_react5 = __toESM(require_react(), 1);
|
|
35652
|
+
var import_react6 = __toESM(require_react(), 1);
|
|
35653
|
+
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
35574
35654
|
|
|
35575
35655
|
// ../wire/dist/index.js
|
|
35576
35656
|
var dist_exports = {};
|
|
@@ -35596,13 +35676,13 @@ __export(dist_exports, {
|
|
|
35596
35676
|
});
|
|
35597
35677
|
|
|
35598
35678
|
// ../wire/dist/WireProvider.js
|
|
35599
|
-
var
|
|
35679
|
+
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
|
|
35600
35680
|
|
|
35601
35681
|
// ../wire/dist/context.js
|
|
35602
|
-
var
|
|
35603
|
-
var WireContext = (0,
|
|
35682
|
+
var import_react = __toESM(require_react(), 1);
|
|
35683
|
+
var WireContext = (0, import_react.createContext)(null);
|
|
35604
35684
|
function useWireContext() {
|
|
35605
|
-
const ctx = (0,
|
|
35685
|
+
const ctx = (0, import_react.useContext)(WireContext);
|
|
35606
35686
|
if (!ctx) {
|
|
35607
35687
|
throw new Error("useWireContext must be used within a WireProvider. Ensure the component is rendered inside a GguiWireProvider.");
|
|
35608
35688
|
}
|
|
@@ -35611,11 +35691,11 @@ function useWireContext() {
|
|
|
35611
35691
|
|
|
35612
35692
|
// ../wire/dist/WireProvider.js
|
|
35613
35693
|
function GguiWireProvider({ config: config2, children }) {
|
|
35614
|
-
return (0,
|
|
35694
|
+
return (0, import_jsx_runtime.jsx)(WireContext.Provider, { value: config2, children });
|
|
35615
35695
|
}
|
|
35616
35696
|
|
|
35617
35697
|
// ../wire/dist/useAction.js
|
|
35618
|
-
var
|
|
35698
|
+
var import_react2 = __toESM(require_react(), 1);
|
|
35619
35699
|
|
|
35620
35700
|
// ../wire/dist/dispatch-dedup.js
|
|
35621
35701
|
var pendingDispatches = /* @__PURE__ */ new Set();
|
|
@@ -35649,7 +35729,7 @@ function tryAcceptDispatch(actionName, data) {
|
|
|
35649
35729
|
// ../wire/dist/useAction.js
|
|
35650
35730
|
function useAction(actionName) {
|
|
35651
35731
|
const { dispatch, onDispatchSuppressed } = useWireContext();
|
|
35652
|
-
return (0,
|
|
35732
|
+
return (0, import_react2.useCallback)((data) => {
|
|
35653
35733
|
const decision = tryAcceptDispatch(actionName, data);
|
|
35654
35734
|
if (decision.suppressed) {
|
|
35655
35735
|
console.warn(`[ggui] useAction('${actionName}') suppressed a duplicate dispatch (same name + payload, same event-loop task). This usually means two interactive elements nest and both wire to the same action (e.g. a Checkbox onChange inside a Card as={Clickable} onClick); the inner gesture bubbles to the outer handler so one user click would fire the action twice. Wire each useAction callback to exactly ONE interactive surface. Tier-0 'double-wired-action' warns on this at gen time; this runtime defense ensures the user-visible behavior stays correct regardless of code shape.`);
|
|
@@ -35672,7 +35752,7 @@ function useAction(actionName) {
|
|
|
35672
35752
|
}
|
|
35673
35753
|
|
|
35674
35754
|
// ../wire/dist/useGguiContext.js
|
|
35675
|
-
var
|
|
35755
|
+
var import_react3 = __toESM(require_react(), 1);
|
|
35676
35756
|
function useGguiContext(slotName) {
|
|
35677
35757
|
const contextName = slotName.length === 0 ? "Context" : slotName.charAt(0).toUpperCase() + slotName.slice(1) + "Context";
|
|
35678
35758
|
const registry2 = globalThis.__ggui__?.contexts;
|
|
@@ -35680,19 +35760,19 @@ function useGguiContext(slotName) {
|
|
|
35680
35760
|
if (!ctx) {
|
|
35681
35761
|
throw new Error(`[ggui] useGguiContext('${slotName}'): no Context registered. The contract must declare 'contextSpec.${slotName}' AND the runtime must have synthesized the per-slot React Context at boot. If you see this in production code generated by the LLM, the boilerplate's destructure line drifted from the contract.`);
|
|
35682
35762
|
}
|
|
35683
|
-
return (0,
|
|
35763
|
+
return (0, import_react3.useContext)(ctx);
|
|
35684
35764
|
}
|
|
35685
35765
|
|
|
35686
35766
|
// ../wire/dist/useStream.js
|
|
35687
|
-
var
|
|
35767
|
+
var import_react4 = __toESM(require_react(), 1);
|
|
35688
35768
|
function useStream(channelName) {
|
|
35689
35769
|
const { subscribe } = useWireContext();
|
|
35690
|
-
const [latest, setLatest] = (0,
|
|
35691
|
-
const [all, setAll] = (0,
|
|
35692
|
-
const [isComplete, setIsComplete] = (0,
|
|
35693
|
-
const allRef = (0,
|
|
35770
|
+
const [latest, setLatest] = (0, import_react4.useState)(null);
|
|
35771
|
+
const [all, setAll] = (0, import_react4.useState)([]);
|
|
35772
|
+
const [isComplete, setIsComplete] = (0, import_react4.useState)(false);
|
|
35773
|
+
const allRef = (0, import_react4.useRef)(all);
|
|
35694
35774
|
allRef.current = all;
|
|
35695
|
-
(0,
|
|
35775
|
+
(0, import_react4.useEffect)(() => {
|
|
35696
35776
|
return subscribe(channelName, (delivery) => {
|
|
35697
35777
|
const typed = delivery.payload;
|
|
35698
35778
|
setLatest(typed);
|
|
@@ -35865,243 +35945,104 @@ function buildWireConfig(opts) {
|
|
|
35865
35945
|
};
|
|
35866
35946
|
}
|
|
35867
35947
|
|
|
35868
|
-
// ../
|
|
35869
|
-
var
|
|
35870
|
-
|
|
35871
|
-
|
|
35872
|
-
var
|
|
35873
|
-
id: external_exports.string().min(1)
|
|
35874
|
-
});
|
|
35875
|
-
var ComponentRef = external_exports.string().min(1);
|
|
35876
|
-
var Align = external_exports.enum(["start", "center", "end", "stretch"]);
|
|
35877
|
-
var Justify = external_exports.enum([
|
|
35878
|
-
"start",
|
|
35879
|
-
"center",
|
|
35880
|
-
"end",
|
|
35881
|
-
"between",
|
|
35882
|
-
"around",
|
|
35883
|
-
"evenly"
|
|
35884
|
-
]);
|
|
35885
|
-
var RowComponent = ComponentBase.extend({
|
|
35886
|
-
component: external_exports.literal("Row"),
|
|
35887
|
-
children: external_exports.array(ComponentRef).optional(),
|
|
35888
|
-
gap: external_exports.string().optional(),
|
|
35889
|
-
align: Align.optional(),
|
|
35890
|
-
justify: Justify.optional()
|
|
35891
|
-
});
|
|
35892
|
-
var ColumnComponent = ComponentBase.extend({
|
|
35893
|
-
component: external_exports.literal("Column"),
|
|
35894
|
-
children: external_exports.array(ComponentRef).optional(),
|
|
35895
|
-
gap: external_exports.string().optional(),
|
|
35896
|
-
align: Align.optional(),
|
|
35897
|
-
justify: Justify.optional()
|
|
35898
|
-
});
|
|
35899
|
-
var CardComponent = ComponentBase.extend({
|
|
35900
|
-
component: external_exports.literal("Card"),
|
|
35901
|
-
child: ComponentRef.optional()
|
|
35902
|
-
});
|
|
35903
|
-
var ListComponent = ComponentBase.extend({
|
|
35904
|
-
component: external_exports.literal("List"),
|
|
35905
|
-
children: external_exports.array(ComponentRef).optional()
|
|
35906
|
-
});
|
|
35907
|
-
var DividerComponent = ComponentBase.extend({
|
|
35908
|
-
component: external_exports.literal("Divider"),
|
|
35909
|
-
orientation: external_exports.enum(["horizontal", "vertical"]).optional()
|
|
35910
|
-
});
|
|
35911
|
-
var TextComponent = ComponentBase.extend({
|
|
35912
|
-
component: external_exports.literal("Text"),
|
|
35913
|
-
text: external_exports.string(),
|
|
35914
|
-
variant: external_exports.string().optional()
|
|
35915
|
-
});
|
|
35916
|
-
var ImageComponent = ComponentBase.extend({
|
|
35917
|
-
component: external_exports.literal("Image"),
|
|
35918
|
-
src: external_exports.string().min(1),
|
|
35919
|
-
alt: external_exports.string().optional()
|
|
35920
|
-
});
|
|
35921
|
-
var IconComponent = ComponentBase.extend({
|
|
35922
|
-
component: external_exports.literal("Icon"),
|
|
35923
|
-
name: external_exports.string().min(1)
|
|
35924
|
-
});
|
|
35925
|
-
var ButtonComponent = ComponentBase.extend({
|
|
35926
|
-
component: external_exports.literal("Button"),
|
|
35927
|
-
label: external_exports.string()
|
|
35928
|
-
});
|
|
35929
|
-
var TextFieldComponent = ComponentBase.extend({
|
|
35930
|
-
component: external_exports.literal("TextField"),
|
|
35931
|
-
label: external_exports.string().optional(),
|
|
35932
|
-
placeholder: external_exports.string().optional(),
|
|
35933
|
-
value: external_exports.string().optional()
|
|
35934
|
-
});
|
|
35935
|
-
var CheckBoxComponent = ComponentBase.extend({
|
|
35936
|
-
component: external_exports.literal("CheckBox"),
|
|
35937
|
-
label: external_exports.string().optional(),
|
|
35938
|
-
checked: external_exports.boolean().optional()
|
|
35939
|
-
});
|
|
35940
|
-
var ChoicePickerOption = external_exports.object({
|
|
35941
|
-
label: external_exports.string(),
|
|
35942
|
-
value: external_exports.string()
|
|
35943
|
-
});
|
|
35944
|
-
var ChoicePickerComponent = ComponentBase.extend({
|
|
35945
|
-
component: external_exports.literal("ChoicePicker"),
|
|
35946
|
-
label: external_exports.string().optional(),
|
|
35947
|
-
options: external_exports.array(ChoicePickerOption).optional(),
|
|
35948
|
-
value: external_exports.string().optional()
|
|
35949
|
-
});
|
|
35950
|
-
var ComponentSchema = external_exports.discriminatedUnion("component", [
|
|
35951
|
-
RowComponent,
|
|
35952
|
-
ColumnComponent,
|
|
35953
|
-
CardComponent,
|
|
35954
|
-
ListComponent,
|
|
35955
|
-
DividerComponent,
|
|
35956
|
-
TextComponent,
|
|
35957
|
-
ImageComponent,
|
|
35958
|
-
IconComponent,
|
|
35959
|
-
ButtonComponent,
|
|
35960
|
-
TextFieldComponent,
|
|
35961
|
-
CheckBoxComponent,
|
|
35962
|
-
ChoicePickerComponent
|
|
35963
|
-
]);
|
|
35964
|
-
|
|
35965
|
-
// ../preview-a2ui/dist/messages.js
|
|
35966
|
-
var A2UI_MESSAGE_VERSION = "v0.9";
|
|
35967
|
-
var VersionLiteral = external_exports.literal(A2UI_MESSAGE_VERSION);
|
|
35968
|
-
var SurfaceId = external_exports.string().min(1);
|
|
35969
|
-
var CreateSurfaceMessageSchema = external_exports.object({
|
|
35970
|
-
version: VersionLiteral,
|
|
35971
|
-
createSurface: external_exports.object({
|
|
35972
|
-
surfaceId: SurfaceId,
|
|
35973
|
-
catalogId: external_exports.string().min(1)
|
|
35974
|
-
})
|
|
35975
|
-
});
|
|
35976
|
-
var UpdateComponentsMessageSchema = external_exports.object({
|
|
35977
|
-
version: VersionLiteral,
|
|
35978
|
-
updateComponents: external_exports.object({
|
|
35979
|
-
surfaceId: SurfaceId,
|
|
35980
|
-
components: external_exports.array(ComponentSchema)
|
|
35981
|
-
})
|
|
35982
|
-
});
|
|
35983
|
-
var DeleteSurfaceMessageSchema = external_exports.object({
|
|
35984
|
-
version: VersionLiteral,
|
|
35985
|
-
deleteSurface: external_exports.object({
|
|
35986
|
-
surfaceId: SurfaceId
|
|
35987
|
-
})
|
|
35988
|
-
});
|
|
35989
|
-
var ServerMessageSchema = external_exports.union([
|
|
35990
|
-
CreateSurfaceMessageSchema,
|
|
35991
|
-
UpdateComponentsMessageSchema,
|
|
35992
|
-
DeleteSurfaceMessageSchema
|
|
35993
|
-
]);
|
|
35994
|
-
|
|
35995
|
-
// ../ggui-react/dist/index.mjs
|
|
35996
|
-
var import_react11 = __toESM(require_react(), 1);
|
|
35948
|
+
// ../mcp-apps-react/dist/index.mjs
|
|
35949
|
+
var import_react7 = __toESM(require_react(), 1);
|
|
35950
|
+
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
35951
|
+
var import_react8 = __toESM(require_react(), 1);
|
|
35952
|
+
var import_react9 = __toESM(require_react(), 1);
|
|
35997
35953
|
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
35998
|
-
var import_react12 = __toESM(require_react(), 1);
|
|
35999
35954
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
36000
|
-
var import_react13 = __toESM(require_react(), 1);
|
|
36001
|
-
var import_react14 = __toESM(require_react(), 1);
|
|
36002
35955
|
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
|
|
35956
|
+
var import_react10 = __toESM(require_react(), 1);
|
|
35957
|
+
var import_react11 = __toESM(require_react(), 1);
|
|
36003
35958
|
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
|
|
36004
35959
|
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
|
|
36005
|
-
var import_react15 = __toESM(require_react(), 1);
|
|
36006
|
-
var import_react16 = __toESM(require_react(), 1);
|
|
36007
35960
|
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
35961
|
+
var import_react12 = __toESM(require_react(), 1);
|
|
36008
35962
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
35963
|
+
var import_react13 = __toESM(require_react(), 1);
|
|
36009
35964
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
36010
|
-
var
|
|
35965
|
+
var import_react14 = __toESM(require_react(), 1);
|
|
36011
35966
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
36012
|
-
var import_react18 = __toESM(require_react(), 1);
|
|
36013
35967
|
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
36014
|
-
var
|
|
35968
|
+
var import_react15 = __toESM(require_react(), 1);
|
|
36015
35969
|
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
35970
|
+
var import_react16 = __toESM(require_react(), 1);
|
|
36016
35971
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
36017
|
-
var
|
|
35972
|
+
var import_react17 = __toESM(require_react(), 1);
|
|
36018
35973
|
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
|
|
36019
|
-
var import_react21 = __toESM(require_react(), 1);
|
|
36020
35974
|
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
|
|
36021
|
-
var import_react22 = __toESM(require_react(), 1);
|
|
36022
35975
|
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
|
|
35976
|
+
var import_react18 = __toESM(require_react(), 1);
|
|
36023
35977
|
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
36024
35978
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
36025
|
-
var import_react23 = __toESM(require_react(), 1);
|
|
36026
35979
|
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
35980
|
+
var import_react19 = __toESM(require_react(), 1);
|
|
36027
35981
|
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
35982
|
+
var import_react20 = __toESM(require_react(), 1);
|
|
36028
35983
|
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
|
|
36029
|
-
var import_react24 = __toESM(require_react(), 1);
|
|
36030
35984
|
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
|
|
36031
|
-
var
|
|
35985
|
+
var import_react21 = __toESM(require_react(), 1);
|
|
36032
35986
|
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
|
|
35987
|
+
var import_react22 = __toESM(require_react(), 1);
|
|
36033
35988
|
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
|
|
36034
|
-
var
|
|
35989
|
+
var import_react23 = __toESM(require_react(), 1);
|
|
36035
35990
|
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
|
|
36036
|
-
var
|
|
35991
|
+
var import_react24 = __toESM(require_react(), 1);
|
|
36037
35992
|
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
|
|
36038
|
-
var
|
|
35993
|
+
var import_react25 = __toESM(require_react(), 1);
|
|
35994
|
+
var import_react26 = __toESM(require_react(), 1);
|
|
36039
35995
|
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
|
|
36040
|
-
var
|
|
35996
|
+
var import_react27 = __toESM(require_react(), 1);
|
|
36041
35997
|
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
|
|
36042
|
-
var import_react30 = __toESM(require_react(), 1);
|
|
36043
|
-
var import_react31 = __toESM(require_react(), 1);
|
|
36044
35998
|
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
|
|
36045
|
-
var import_react32 = __toESM(require_react(), 1);
|
|
36046
35999
|
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
|
|
36047
36000
|
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
|
|
36001
|
+
var import_react28 = __toESM(require_react(), 1);
|
|
36048
36002
|
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
|
|
36003
|
+
var import_react29 = __toESM(require_react(), 1);
|
|
36049
36004
|
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
|
|
36050
|
-
var
|
|
36005
|
+
var import_react30 = __toESM(require_react(), 1);
|
|
36051
36006
|
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
|
|
36052
|
-
var import_react34 = __toESM(require_react(), 1);
|
|
36053
36007
|
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
|
|
36054
|
-
var import_react35 = __toESM(require_react(), 1);
|
|
36055
36008
|
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
|
|
36056
36009
|
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
|
|
36057
36010
|
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
|
|
36058
36011
|
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
|
|
36059
36012
|
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
|
|
36013
|
+
var import_react31 = __toESM(require_react(), 1);
|
|
36060
36014
|
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
|
|
36061
36015
|
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
|
|
36062
|
-
var
|
|
36016
|
+
var import_react32 = __toESM(require_react(), 1);
|
|
36063
36017
|
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
|
|
36064
36018
|
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
|
|
36065
|
-
var
|
|
36019
|
+
var import_react33 = __toESM(require_react(), 1);
|
|
36066
36020
|
var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
|
|
36067
36021
|
var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
|
|
36068
|
-
var
|
|
36022
|
+
var import_react34 = __toESM(require_react(), 1);
|
|
36069
36023
|
var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
|
|
36070
36024
|
var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
|
|
36071
|
-
var
|
|
36025
|
+
var import_react35 = __toESM(require_react(), 1);
|
|
36072
36026
|
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
|
|
36027
|
+
var import_react36 = __toESM(require_react(), 1);
|
|
36073
36028
|
var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
|
|
36074
|
-
var import_react40 = __toESM(require_react(), 1);
|
|
36075
36029
|
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
|
|
36076
|
-
var import_react41 = __toESM(require_react(), 1);
|
|
36077
36030
|
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
|
|
36031
|
+
var import_react37 = __toESM(require_react(), 1);
|
|
36078
36032
|
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
|
|
36033
|
+
var import_react38 = __toESM(require_react(), 1);
|
|
36079
36034
|
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
|
|
36080
|
-
var
|
|
36035
|
+
var import_react39 = __toESM(require_react(), 1);
|
|
36081
36036
|
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
|
|
36082
|
-
var
|
|
36037
|
+
var import_react40 = __toESM(require_react(), 1);
|
|
36083
36038
|
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
|
|
36084
|
-
var import_react44 = __toESM(require_react(), 1);
|
|
36085
36039
|
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
|
|
36086
|
-
var
|
|
36040
|
+
var import_react41 = __toESM(require_react(), 1);
|
|
36087
36041
|
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
|
|
36088
|
-
var import_react46 = __toESM(require_react(), 1);
|
|
36089
36042
|
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
|
|
36090
|
-
var
|
|
36091
|
-
var
|
|
36092
|
-
var
|
|
36093
|
-
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
|
|
36094
|
-
var import_react48 = __toESM(require_react(), 1);
|
|
36095
|
-
var import_react49 = __toESM(require_react(), 1);
|
|
36096
|
-
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
|
|
36097
|
-
var import_react50 = __toESM(require_react(), 1);
|
|
36098
|
-
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
|
|
36099
|
-
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
|
|
36100
|
-
var import_react51 = __toESM(require_react(), 1);
|
|
36101
|
-
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
|
|
36102
|
-
var import_react52 = __toESM(require_react(), 1);
|
|
36103
|
-
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
|
|
36104
|
-
var StreamBusContext = (0, import_react11.createContext)(null);
|
|
36043
|
+
var import_react42 = __toESM(require_react(), 1);
|
|
36044
|
+
var GguiContext = (0, import_react6.createContext)(null);
|
|
36045
|
+
var KNOWN_PERMISSION_NAMES_SET2 = new Set(KNOWN_PERMISSION_NAMES);
|
|
36105
36046
|
var primitives_exports = {};
|
|
36106
36047
|
__export2(primitives_exports, {
|
|
36107
36048
|
Accordion: () => Accordion,
|
|
@@ -36214,7 +36155,7 @@ var maxWidthMap = {
|
|
|
36214
36155
|
function Container({ children, maxWidth: maxWidth2 = "lg", center = true, padding, style, className }) {
|
|
36215
36156
|
const resolvedMaxWidth = maxWidthMap[maxWidth2] || maxWidth2;
|
|
36216
36157
|
const resolvedPadding = resolveSpacing(padding);
|
|
36217
|
-
return (0,
|
|
36158
|
+
return (0, import_jsx_runtime3.jsx)("div", { className, style: {
|
|
36218
36159
|
maxWidth: resolvedMaxWidth,
|
|
36219
36160
|
margin: center ? "0 auto" : void 0,
|
|
36220
36161
|
padding: resolvedPadding,
|
|
@@ -36224,9 +36165,9 @@ function Container({ children, maxWidth: maxWidth2 = "lg", center = true, paddin
|
|
|
36224
36165
|
}
|
|
36225
36166
|
function renderWithTrait(trait, traitProps, root, children) {
|
|
36226
36167
|
if (trait === void 0) {
|
|
36227
|
-
return (0,
|
|
36168
|
+
return (0, import_react8.createElement)("div", { className: root.className, style: root.style }, children);
|
|
36228
36169
|
}
|
|
36229
|
-
return (0,
|
|
36170
|
+
return (0, import_react8.createElement)(trait, { ...traitProps, className: root.className, style: root.style }, children);
|
|
36230
36171
|
}
|
|
36231
36172
|
function resolveToneCss(tone) {
|
|
36232
36173
|
switch (tone) {
|
|
@@ -36351,7 +36292,7 @@ function Stack(props) {
|
|
|
36351
36292
|
return renderWithTrait(Trait, traitProps, { className, style: composedStyle }, children);
|
|
36352
36293
|
}
|
|
36353
36294
|
function Row(props) {
|
|
36354
|
-
return (0,
|
|
36295
|
+
return (0, import_react9.createElement)(Stack, { ...props, direction: "horizontal" });
|
|
36355
36296
|
}
|
|
36356
36297
|
var BREAKPOINTS = [
|
|
36357
36298
|
["sm", 640],
|
|
@@ -36395,7 +36336,7 @@ function Grid(props) {
|
|
|
36395
36336
|
gap: resolveSpacing(gap),
|
|
36396
36337
|
...style
|
|
36397
36338
|
};
|
|
36398
|
-
return renderWithTrait(Trait, traitProps, { className: className ? `${className} ${cls}` : cls, style: composedStyle2 }, (0,
|
|
36339
|
+
return renderWithTrait(Trait, traitProps, { className: className ? `${className} ${cls}` : cls, style: composedStyle2 }, (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [(0, import_jsx_runtime4.jsx)("style", { children: rules.join("") }), children] }));
|
|
36399
36340
|
}
|
|
36400
36341
|
const composedStyle = {
|
|
36401
36342
|
display: "grid",
|
|
@@ -36430,7 +36371,7 @@ function Divider({ orientation = "horizontal", margin = "var(--ggui-spacing-md,
|
|
|
36430
36371
|
const resolvedMargin = typeof margin === "number" ? `${margin}px` : margin;
|
|
36431
36372
|
const dividerColor = tone ? resolveToneCss(tone) : "var(--ggui-color-outlineVariant, #e4e4e7)";
|
|
36432
36373
|
if (orientation === "vertical") {
|
|
36433
|
-
return (0,
|
|
36374
|
+
return (0, import_jsx_runtime5.jsx)("div", { role: "separator", "aria-orientation": "vertical", className, style: {
|
|
36434
36375
|
width: "1px",
|
|
36435
36376
|
backgroundColor: dividerColor,
|
|
36436
36377
|
margin: `0 ${resolvedMargin}`,
|
|
@@ -36438,7 +36379,7 @@ function Divider({ orientation = "horizontal", margin = "var(--ggui-spacing-md,
|
|
|
36438
36379
|
...style
|
|
36439
36380
|
} });
|
|
36440
36381
|
}
|
|
36441
|
-
return (0,
|
|
36382
|
+
return (0, import_jsx_runtime5.jsx)("hr", { role: "separator", "aria-orientation": "horizontal", className, style: {
|
|
36442
36383
|
border: "none",
|
|
36443
36384
|
height: "1px",
|
|
36444
36385
|
backgroundColor: dividerColor,
|
|
@@ -36448,12 +36389,12 @@ function Divider({ orientation = "horizontal", margin = "var(--ggui-spacing-md,
|
|
|
36448
36389
|
}
|
|
36449
36390
|
function Spacer({ size = 16, style, className }) {
|
|
36450
36391
|
if (size === "flex") {
|
|
36451
|
-
return (0,
|
|
36392
|
+
return (0, import_jsx_runtime6.jsx)("div", { className, style: {
|
|
36452
36393
|
flex: 1,
|
|
36453
36394
|
...style
|
|
36454
36395
|
} });
|
|
36455
36396
|
}
|
|
36456
|
-
return (0,
|
|
36397
|
+
return (0, import_jsx_runtime6.jsx)("div", { className, style: {
|
|
36457
36398
|
width: `${size}px`,
|
|
36458
36399
|
height: `${size}px`,
|
|
36459
36400
|
flexShrink: 0,
|
|
@@ -36507,7 +36448,7 @@ function Text({ children, size = "base", weight = "normal", caps = false, tone,
|
|
|
36507
36448
|
...style
|
|
36508
36449
|
};
|
|
36509
36450
|
const elementProps = { id, htmlFor, className, style: textStyle };
|
|
36510
|
-
return (0,
|
|
36451
|
+
return (0, import_react10.createElement)(is, elementProps, children);
|
|
36511
36452
|
}
|
|
36512
36453
|
var fontSize = {
|
|
36513
36454
|
xs: "12px",
|
|
@@ -36590,7 +36531,7 @@ function Heading({ children, level = 2, tone, align, style, className }) {
|
|
|
36590
36531
|
const tag = `h${level}`;
|
|
36591
36532
|
const headingStyle = headingStyles[tag] || headingStyles.h2;
|
|
36592
36533
|
const resolvedColor = tone ? resolveToneCss(tone) : "var(--ggui-color-onSurface, #18181b)";
|
|
36593
|
-
return (0,
|
|
36534
|
+
return (0, import_react11.createElement)(tag, {
|
|
36594
36535
|
className,
|
|
36595
36536
|
style: {
|
|
36596
36537
|
...headingStyle,
|
|
@@ -36603,10 +36544,10 @@ function Heading({ children, level = 2, tone, align, style, className }) {
|
|
|
36603
36544
|
}
|
|
36604
36545
|
function Spinner({ size = 24, tone, style, className }) {
|
|
36605
36546
|
const spinnerColor = tone === "inherit" ? "currentColor" : tone ? resolveToneCss(tone) : "var(--ggui-color-primary-600, #0284c7)";
|
|
36606
|
-
return (0,
|
|
36547
|
+
return (0, import_jsx_runtime8.jsxs)("svg", { className, width: size, height: size, viewBox: "0 0 24 24", fill: "none", role: "status", "aria-label": "Loading", style: {
|
|
36607
36548
|
animation: "ggui-spin 1s linear infinite",
|
|
36608
36549
|
...style
|
|
36609
|
-
}, children: [(0,
|
|
36550
|
+
}, children: [(0, import_jsx_runtime8.jsx)("style", { children: `@keyframes ggui-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }` }), (0, import_jsx_runtime8.jsx)("circle", { cx: "12", cy: "12", r: "10", stroke: "var(--ggui-color-outlineVariant, #e4e4e7)", strokeWidth: "3", fill: "none" }), (0, import_jsx_runtime8.jsx)("path", { d: "M12 2a10 10 0 0 1 10 10", stroke: spinnerColor, strokeWidth: "3", strokeLinecap: "round", fill: "none" })] });
|
|
36610
36551
|
}
|
|
36611
36552
|
var duration3 = {
|
|
36612
36553
|
instant: "0ms",
|
|
@@ -36683,7 +36624,7 @@ var variantStyles = {
|
|
|
36683
36624
|
function Button({ children, variant = "primary", size = "md", fullWidth, loading, disabled, leftIcon, rightIcon, type = "button", onClick, onPress, style, className, ...rest }) {
|
|
36684
36625
|
const isDisabled = disabled || loading;
|
|
36685
36626
|
const handleClick = onClick ?? onPress;
|
|
36686
|
-
return (0,
|
|
36627
|
+
return (0, import_jsx_runtime7.jsx)("button", { type, onClick: isDisabled ? void 0 : handleClick, disabled: isDisabled, className, style: {
|
|
36687
36628
|
...sizeStyles[size],
|
|
36688
36629
|
...variantStyles[variant],
|
|
36689
36630
|
display: "inline-flex",
|
|
@@ -36698,7 +36639,7 @@ function Button({ children, variant = "primary", size = "md", fullWidth, loading
|
|
|
36698
36639
|
transition: `background-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}, opacity ${duration3.normal} ${easing.easeInOut}`,
|
|
36699
36640
|
boxShadow: "var(--ggui-shape-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))",
|
|
36700
36641
|
...style
|
|
36701
|
-
}, ...rest, children: loading ? (0,
|
|
36642
|
+
}, ...rest, children: loading ? (0, import_jsx_runtime7.jsx)(Spinner, { size: 16, tone: "inherit" }) : (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [leftIcon, children, rightIcon] }) });
|
|
36702
36643
|
}
|
|
36703
36644
|
var sizeStyles2 = {
|
|
36704
36645
|
sm: {
|
|
@@ -36715,21 +36656,21 @@ var sizeStyles2 = {
|
|
|
36715
36656
|
}
|
|
36716
36657
|
};
|
|
36717
36658
|
function Input({ label, placeholder, value, onChange, type = "text", error: error210, helperText, required: required2, disabled, size = "md", style, className, ...rest }) {
|
|
36718
|
-
const uniqueId = (0,
|
|
36659
|
+
const uniqueId = (0, import_react12.useId)();
|
|
36719
36660
|
const inputId = `${uniqueId}-input`;
|
|
36720
36661
|
const messageId = `${uniqueId}-message`;
|
|
36721
36662
|
const hasError = Boolean(error210);
|
|
36722
36663
|
const hasMessage = Boolean(error210 || helperText);
|
|
36723
|
-
return (0,
|
|
36664
|
+
return (0, import_jsx_runtime9.jsxs)("div", { className, style: {
|
|
36724
36665
|
display: "flex",
|
|
36725
36666
|
flexDirection: "column",
|
|
36726
36667
|
gap: "var(--ggui-spacing-1, 4px)",
|
|
36727
36668
|
...style
|
|
36728
|
-
}, children: [label && (0,
|
|
36669
|
+
}, children: [label && (0, import_jsx_runtime9.jsxs)("label", { htmlFor: inputId, style: {
|
|
36729
36670
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36730
36671
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36731
36672
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36732
|
-
}, children: [label, required2 && (0,
|
|
36673
|
+
}, children: [label, required2 && (0, import_jsx_runtime9.jsx)("span", { "aria-hidden": "true", style: { color: "var(--ggui-color-error-500, #ef4444)", marginLeft: "2px" }, children: "*" })] }), (0, import_jsx_runtime9.jsx)("input", { id: inputId, type, placeholder, value, onChange: (e) => onChange?.(e.target.value), disabled, required: required2, "aria-invalid": hasError || void 0, "aria-describedby": hasMessage ? messageId : void 0, style: {
|
|
36733
36674
|
...sizeStyles2[size],
|
|
36734
36675
|
width: "100%",
|
|
36735
36676
|
borderRadius: "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -36738,28 +36679,28 @@ function Input({ label, placeholder, value, onChange, type = "text", error: erro
|
|
|
36738
36679
|
color: "var(--ggui-color-onSurface, #18181b)",
|
|
36739
36680
|
transition: `border-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}`,
|
|
36740
36681
|
boxSizing: "border-box"
|
|
36741
|
-
}, ...rest }), hasMessage && (0,
|
|
36682
|
+
}, ...rest }), hasMessage && (0, import_jsx_runtime9.jsx)("span", { id: messageId, role: hasError ? "alert" : void 0, style: {
|
|
36742
36683
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36743
36684
|
color: hasError ? "var(--ggui-color-error-500, #ef4444)" : "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36744
36685
|
}, children: error210 || helperText })] });
|
|
36745
36686
|
}
|
|
36746
36687
|
function TextArea({ label, placeholder, value, onChange, rows = 4, error: error210, helperText, required: required2, disabled, maxLength, showCount, autoResize, style, className, ...rest }) {
|
|
36747
|
-
const uniqueId = (0,
|
|
36688
|
+
const uniqueId = (0, import_react13.useId)();
|
|
36748
36689
|
const textareaId = `${uniqueId}-textarea`;
|
|
36749
36690
|
const messageId = `${uniqueId}-message`;
|
|
36750
36691
|
const hasError = Boolean(error210);
|
|
36751
36692
|
const hasMessage = Boolean(error210 || helperText);
|
|
36752
36693
|
const charCount = value?.length || 0;
|
|
36753
|
-
return (0,
|
|
36694
|
+
return (0, import_jsx_runtime10.jsxs)("div", { className, style: {
|
|
36754
36695
|
display: "flex",
|
|
36755
36696
|
flexDirection: "column",
|
|
36756
36697
|
gap: "var(--ggui-spacing-1, 4px)",
|
|
36757
36698
|
...style
|
|
36758
|
-
}, children: [label && (0,
|
|
36699
|
+
}, children: [label && (0, import_jsx_runtime10.jsxs)("label", { htmlFor: textareaId, style: {
|
|
36759
36700
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36760
36701
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36761
36702
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36762
|
-
}, children: [label, required2 && (0,
|
|
36703
|
+
}, children: [label, required2 && (0, import_jsx_runtime10.jsx)("span", { "aria-hidden": "true", style: { color: "var(--ggui-color-error-500, #ef4444)", marginLeft: "2px" }, children: "*" })] }), (0, import_jsx_runtime10.jsx)("textarea", { id: textareaId, placeholder, value, onChange: (e) => onChange?.(e.target.value), rows, disabled, required: required2, maxLength, "aria-invalid": hasError || void 0, "aria-describedby": hasMessage ? messageId : void 0, style: {
|
|
36763
36704
|
padding: "10px 12px",
|
|
36764
36705
|
width: "100%",
|
|
36765
36706
|
borderRadius: "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -36771,10 +36712,10 @@ function TextArea({ label, placeholder, value, onChange, rows = 4, error: error2
|
|
|
36771
36712
|
transition: `border-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}`,
|
|
36772
36713
|
boxSizing: "border-box",
|
|
36773
36714
|
resize: autoResize ? "none" : "vertical"
|
|
36774
|
-
}, ...rest }), (0,
|
|
36715
|
+
}, ...rest }), (0, import_jsx_runtime10.jsxs)("div", { style: { display: "flex", justifyContent: "space-between" }, children: [hasMessage && (0, import_jsx_runtime10.jsx)("span", { id: messageId, role: hasError ? "alert" : void 0, style: {
|
|
36775
36716
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36776
36717
|
color: hasError ? "var(--ggui-color-error-500, #ef4444)" : "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36777
|
-
}, children: error210 || helperText }), showCount && maxLength && (0,
|
|
36718
|
+
}, children: error210 || helperText }), showCount && maxLength && (0, import_jsx_runtime10.jsxs)("span", { style: {
|
|
36778
36719
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36779
36720
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)",
|
|
36780
36721
|
marginLeft: "auto"
|
|
@@ -36786,16 +36727,16 @@ var sizeStyles3 = {
|
|
|
36786
36727
|
lg: { padding: "12px 14px", fontSize: "var(--ggui-font-size-base, 16px)" }
|
|
36787
36728
|
};
|
|
36788
36729
|
function Select({ label, value, onChange, options, placeholder, error: error210, helperText, required: required2, disabled, size = "md", style, className, ...rest }) {
|
|
36789
|
-
const uniqueId = (0,
|
|
36730
|
+
const uniqueId = (0, import_react14.useId)();
|
|
36790
36731
|
const selectId = `${uniqueId}-select`;
|
|
36791
36732
|
const messageId = `${uniqueId}-message`;
|
|
36792
36733
|
const hasError = Boolean(error210);
|
|
36793
36734
|
const hasMessage = Boolean(error210 || helperText);
|
|
36794
|
-
return (0,
|
|
36735
|
+
return (0, import_jsx_runtime11.jsxs)("div", { className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-1, 4px)", ...style }, children: [label && (0, import_jsx_runtime11.jsxs)("label", { htmlFor: selectId, style: {
|
|
36795
36736
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36796
36737
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36797
36738
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36798
|
-
}, children: [label, required2 && (0,
|
|
36739
|
+
}, children: [label, required2 && (0, import_jsx_runtime11.jsx)("span", { "aria-hidden": "true", style: { color: "var(--ggui-color-error-500, #ef4444)", marginLeft: "2px" }, children: "*" })] }), (0, import_jsx_runtime11.jsxs)("select", { id: selectId, value, onChange: (e) => onChange?.(e.target.value), disabled, required: required2, "aria-invalid": hasError || void 0, "aria-describedby": hasMessage ? messageId : void 0, style: {
|
|
36799
36740
|
...sizeStyles3[size],
|
|
36800
36741
|
width: "100%",
|
|
36801
36742
|
borderRadius: "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -36810,26 +36751,26 @@ function Select({ label, value, onChange, options, placeholder, error: error210,
|
|
|
36810
36751
|
paddingRight: "36px",
|
|
36811
36752
|
boxSizing: "border-box",
|
|
36812
36753
|
transition: `border-color ${duration3.normal} ${easing.easeInOut}, box-shadow ${duration3.normal} ${easing.easeInOut}`
|
|
36813
|
-
}, ...rest, children: [placeholder && (0,
|
|
36754
|
+
}, ...rest, children: [placeholder && (0, import_jsx_runtime11.jsx)("option", { value: "", disabled: true, children: placeholder }), options.map((opt) => (0, import_jsx_runtime11.jsx)("option", { value: opt.value, disabled: opt.disabled, children: opt.label }, opt.value))] }), hasMessage && (0, import_jsx_runtime11.jsx)("span", { id: messageId, role: hasError ? "alert" : void 0, style: {
|
|
36814
36755
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36815
36756
|
color: hasError ? "var(--ggui-color-error-500, #ef4444)" : "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36816
36757
|
}, children: error210 || helperText })] });
|
|
36817
36758
|
}
|
|
36818
36759
|
function Checkbox({ label, checked, onChange, disabled, description, indeterminate, style, className }) {
|
|
36819
|
-
return (0,
|
|
36760
|
+
return (0, import_jsx_runtime12.jsxs)("label", { className, style: {
|
|
36820
36761
|
display: "flex",
|
|
36821
36762
|
alignItems: "flex-start",
|
|
36822
36763
|
gap: "var(--ggui-spacing-2, 8px)",
|
|
36823
36764
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
36824
36765
|
opacity: disabled ? 0.5 : 1,
|
|
36825
36766
|
...style
|
|
36826
|
-
}, children: [(0,
|
|
36767
|
+
}, children: [(0, import_jsx_runtime12.jsxs)("div", { style: {
|
|
36827
36768
|
position: "relative",
|
|
36828
36769
|
width: "18px",
|
|
36829
36770
|
height: "18px",
|
|
36830
36771
|
flexShrink: 0,
|
|
36831
36772
|
marginTop: "2px"
|
|
36832
|
-
}, children: [(0,
|
|
36773
|
+
}, children: [(0, import_jsx_runtime12.jsx)("input", { type: "checkbox", checked, onChange: (e) => onChange?.(e.target.checked), disabled, ref: (el) => {
|
|
36833
36774
|
if (el)
|
|
36834
36775
|
el.indeterminate = indeterminate || false;
|
|
36835
36776
|
}, style: {
|
|
@@ -36839,7 +36780,7 @@ function Checkbox({ label, checked, onChange, disabled, description, indetermina
|
|
|
36839
36780
|
margin: 0,
|
|
36840
36781
|
opacity: 0,
|
|
36841
36782
|
cursor: disabled ? "not-allowed" : "pointer"
|
|
36842
|
-
} }), (0,
|
|
36783
|
+
} }), (0, import_jsx_runtime12.jsx)("div", { style: {
|
|
36843
36784
|
width: "18px",
|
|
36844
36785
|
height: "18px",
|
|
36845
36786
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)",
|
|
@@ -36849,11 +36790,11 @@ function Checkbox({ label, checked, onChange, disabled, description, indetermina
|
|
|
36849
36790
|
alignItems: "center",
|
|
36850
36791
|
justifyContent: "center",
|
|
36851
36792
|
transition: "all 0.2s"
|
|
36852
|
-
}, children: (checked || indeterminate) && (0,
|
|
36793
|
+
}, children: (checked || indeterminate) && (0, import_jsx_runtime12.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", style: { color: "#ffffff" }, children: indeterminate ? (0, import_jsx_runtime12.jsx)("path", { d: "M2.5 6H9.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) : (0, import_jsx_runtime12.jsx)("path", { d: "M2.5 6L5 8.5L9.5 3.5", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }) }) })] }), (label || description) && (0, import_jsx_runtime12.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [label && (0, import_jsx_runtime12.jsx)("span", { style: {
|
|
36853
36794
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36854
36795
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36855
36796
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36856
|
-
}, children: label }), description && (0,
|
|
36797
|
+
}, children: label }), description && (0, import_jsx_runtime12.jsx)("span", { style: {
|
|
36857
36798
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36858
36799
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36859
36800
|
}, children: description })] })] });
|
|
@@ -36865,15 +36806,15 @@ var sizeConfig = {
|
|
|
36865
36806
|
};
|
|
36866
36807
|
function Toggle({ label, checked, onChange, disabled, size = "md", style, className }) {
|
|
36867
36808
|
const config2 = sizeConfig[size];
|
|
36868
|
-
const [focused, setFocused] = (0,
|
|
36869
|
-
return (0,
|
|
36809
|
+
const [focused, setFocused] = (0, import_react15.useState)(false);
|
|
36810
|
+
return (0, import_jsx_runtime13.jsxs)("label", { className, style: {
|
|
36870
36811
|
display: "flex",
|
|
36871
36812
|
alignItems: "center",
|
|
36872
36813
|
gap: "var(--ggui-spacing-2, 8px)",
|
|
36873
36814
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
36874
36815
|
opacity: disabled ? 0.5 : 1,
|
|
36875
36816
|
...style
|
|
36876
|
-
}, children: [(0,
|
|
36817
|
+
}, children: [(0, import_jsx_runtime13.jsx)("div", { role: "switch", "aria-checked": checked, "aria-label": label, tabIndex: disabled ? -1 : 0, onClick: () => !disabled && onChange?.(!checked), onKeyDown: (e) => {
|
|
36877
36818
|
if (disabled)
|
|
36878
36819
|
return;
|
|
36879
36820
|
if (e.key === " " || e.key === "Enter") {
|
|
@@ -36890,7 +36831,7 @@ function Toggle({ label, checked, onChange, disabled, size = "md", style, classN
|
|
|
36890
36831
|
flexShrink: 0,
|
|
36891
36832
|
outline: "none",
|
|
36892
36833
|
boxShadow: focused ? "0 0 0 3px var(--ggui-color-primary-200, #bae6fd)" : void 0
|
|
36893
|
-
}, children: (0,
|
|
36834
|
+
}, children: (0, import_jsx_runtime13.jsx)("div", { style: {
|
|
36894
36835
|
width: config2.knob,
|
|
36895
36836
|
height: config2.knob,
|
|
36896
36837
|
borderRadius: "50%",
|
|
@@ -36900,23 +36841,23 @@ function Toggle({ label, checked, onChange, disabled, size = "md", style, classN
|
|
|
36900
36841
|
left: checked ? config2.width - config2.knob - (config2.height - config2.knob) / 2 : (config2.height - config2.knob) / 2,
|
|
36901
36842
|
transition: `left ${duration3.normal} ${easing.easeInOut}`,
|
|
36902
36843
|
boxShadow: "var(--ggui-shape-shadow-sm, 0 1px 2px rgba(0,0,0,0.05))"
|
|
36903
|
-
} }) }), label && (0,
|
|
36844
|
+
} }) }), label && (0, import_jsx_runtime13.jsx)("span", { style: {
|
|
36904
36845
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36905
36846
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36906
36847
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36907
36848
|
}, children: label })] });
|
|
36908
36849
|
}
|
|
36909
36850
|
function RadioGroup({ label, value, onChange, options, direction = "vertical", disabled, error: error210, style, className }) {
|
|
36910
|
-
const uniqueId = (0,
|
|
36851
|
+
const uniqueId = (0, import_react16.useId)();
|
|
36911
36852
|
const labelId = `${uniqueId}-label`;
|
|
36912
36853
|
const errorId = `${uniqueId}-error`;
|
|
36913
36854
|
const groupName = `${uniqueId}-radio`;
|
|
36914
36855
|
const hasError = Boolean(error210);
|
|
36915
|
-
return (0,
|
|
36856
|
+
return (0, import_jsx_runtime14.jsxs)("div", { role: "radiogroup", "aria-labelledby": label ? labelId : void 0, "aria-describedby": hasError ? errorId : void 0, className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-2, 8px)", ...style }, children: [label && (0, import_jsx_runtime14.jsx)("span", { id: labelId, style: {
|
|
36916
36857
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36917
36858
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36918
36859
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36919
|
-
}, children: label }), (0,
|
|
36860
|
+
}, children: label }), (0, import_jsx_runtime14.jsx)("div", { style: {
|
|
36920
36861
|
display: "flex",
|
|
36921
36862
|
flexDirection: direction === "vertical" ? "column" : "row",
|
|
36922
36863
|
gap: direction === "vertical" ? "var(--ggui-spacing-2, 8px)" : "var(--ggui-spacing-4, 16px)",
|
|
@@ -36924,26 +36865,26 @@ function RadioGroup({ label, value, onChange, options, direction = "vertical", d
|
|
|
36924
36865
|
}, children: options.map((option) => {
|
|
36925
36866
|
const isSelected = value === option.value;
|
|
36926
36867
|
const isDisabled = disabled || option.disabled;
|
|
36927
|
-
return (0,
|
|
36868
|
+
return (0, import_jsx_runtime14.jsxs)("label", { style: {
|
|
36928
36869
|
display: "flex",
|
|
36929
36870
|
alignItems: "flex-start",
|
|
36930
36871
|
gap: "var(--ggui-spacing-2, 8px)",
|
|
36931
36872
|
cursor: isDisabled ? "not-allowed" : "pointer",
|
|
36932
36873
|
opacity: isDisabled ? 0.5 : 1
|
|
36933
|
-
}, children: [(0,
|
|
36874
|
+
}, children: [(0, import_jsx_runtime14.jsxs)("div", { style: {
|
|
36934
36875
|
position: "relative",
|
|
36935
36876
|
width: "18px",
|
|
36936
36877
|
height: "18px",
|
|
36937
36878
|
flexShrink: 0,
|
|
36938
36879
|
marginTop: "2px"
|
|
36939
|
-
}, children: [(0,
|
|
36880
|
+
}, children: [(0, import_jsx_runtime14.jsx)("input", { type: "radio", name: groupName, value: option.value, checked: isSelected, onChange: () => onChange?.(option.value), disabled: isDisabled, style: {
|
|
36940
36881
|
position: "absolute",
|
|
36941
36882
|
width: "18px",
|
|
36942
36883
|
height: "18px",
|
|
36943
36884
|
margin: 0,
|
|
36944
36885
|
opacity: 0,
|
|
36945
36886
|
cursor: isDisabled ? "not-allowed" : "pointer"
|
|
36946
|
-
} }), (0,
|
|
36887
|
+
} }), (0, import_jsx_runtime14.jsx)("div", { style: {
|
|
36947
36888
|
width: "18px",
|
|
36948
36889
|
height: "18px",
|
|
36949
36890
|
borderRadius: "var(--ggui-shape-radius-full, 9999px)",
|
|
@@ -36953,51 +36894,51 @@ function RadioGroup({ label, value, onChange, options, direction = "vertical", d
|
|
|
36953
36894
|
alignItems: "center",
|
|
36954
36895
|
justifyContent: "center",
|
|
36955
36896
|
transition: "all 0.2s"
|
|
36956
|
-
}, children: isSelected && (0,
|
|
36897
|
+
}, children: isSelected && (0, import_jsx_runtime14.jsx)("div", { style: {
|
|
36957
36898
|
width: "8px",
|
|
36958
36899
|
height: "8px",
|
|
36959
36900
|
borderRadius: "var(--ggui-shape-radius-full, 9999px)",
|
|
36960
36901
|
backgroundColor: "var(--ggui-color-primary-600, #0284c7)"
|
|
36961
|
-
} }) })] }), (0,
|
|
36902
|
+
} }) })] }), (0, import_jsx_runtime14.jsxs)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: [(0, import_jsx_runtime14.jsx)("span", { style: {
|
|
36962
36903
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36963
36904
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36964
36905
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36965
|
-
}, children: option.label }), option.description && (0,
|
|
36906
|
+
}, children: option.label }), option.description && (0, import_jsx_runtime14.jsx)("span", { style: {
|
|
36966
36907
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36967
36908
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36968
36909
|
}, children: option.description })] })] }, option.value);
|
|
36969
|
-
}) }), error210 && (0,
|
|
36910
|
+
}) }), error210 && (0, import_jsx_runtime14.jsx)("span", { id: errorId, role: "alert", style: {
|
|
36970
36911
|
fontSize: "var(--ggui-font-size-xs, 12px)",
|
|
36971
36912
|
color: "var(--ggui-color-error-500, #ef4444)"
|
|
36972
36913
|
}, children: error210 })] });
|
|
36973
36914
|
}
|
|
36974
36915
|
function Slider({ label, value = 0, onChange, min = 0, max = 100, step = 1, disabled, showValue, style, className }) {
|
|
36975
|
-
const uniqueId = (0,
|
|
36916
|
+
const uniqueId = (0, import_react17.useId)();
|
|
36976
36917
|
const sliderId = `${uniqueId}-slider`;
|
|
36977
36918
|
const labelId = `${uniqueId}-label`;
|
|
36978
36919
|
const percentage = (value - min) / (max - min) * 100;
|
|
36979
|
-
return (0,
|
|
36920
|
+
return (0, import_jsx_runtime15.jsxs)("div", { className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-2, 8px)", ...style }, children: [(label || showValue) && (0, import_jsx_runtime15.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [label && (0, import_jsx_runtime15.jsx)("span", { id: labelId, style: {
|
|
36980
36921
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36981
36922
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36982
36923
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
36983
|
-
}, children: label }), showValue && (0,
|
|
36924
|
+
}, children: label }), showValue && (0, import_jsx_runtime15.jsx)("span", { style: {
|
|
36984
36925
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
36985
36926
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
36986
36927
|
color: "var(--ggui-color-primary-600, #0284c7)"
|
|
36987
|
-
}, children: value })] }), (0,
|
|
36928
|
+
}, children: value })] }), (0, import_jsx_runtime15.jsxs)("div", { style: { position: "relative", height: "20px", display: "flex", alignItems: "center" }, children: [(0, import_jsx_runtime15.jsx)("div", { style: {
|
|
36988
36929
|
position: "absolute",
|
|
36989
36930
|
width: "100%",
|
|
36990
36931
|
height: "6px",
|
|
36991
36932
|
borderRadius: "3px",
|
|
36992
36933
|
backgroundColor: "var(--ggui-color-outlineVariant, #e4e4e7)"
|
|
36993
|
-
} }), (0,
|
|
36934
|
+
} }), (0, import_jsx_runtime15.jsx)("div", { style: {
|
|
36994
36935
|
position: "absolute",
|
|
36995
36936
|
width: `${percentage}%`,
|
|
36996
36937
|
height: "6px",
|
|
36997
36938
|
borderRadius: "3px",
|
|
36998
36939
|
backgroundColor: disabled ? "var(--ggui-color-outline, #d4d4d8)" : "var(--ggui-color-primary-600, #0284c7)",
|
|
36999
36940
|
transition: "width 0.1s"
|
|
37000
|
-
} }), (0,
|
|
36941
|
+
} }), (0, import_jsx_runtime15.jsx)("input", { id: sliderId, type: "range", min, max, step, value, onChange: (e) => onChange?.(Number(e.target.value)), disabled, "aria-labelledby": label ? labelId : void 0, "aria-label": label ? void 0 : "Slider", "aria-valuenow": value, "aria-valuemin": min, "aria-valuemax": max, style: {
|
|
37001
36942
|
position: "absolute",
|
|
37002
36943
|
width: "100%",
|
|
37003
36944
|
height: "20px",
|
|
@@ -37005,7 +36946,7 @@ function Slider({ label, value = 0, onChange, min = 0, max = 100, step = 1, disa
|
|
|
37005
36946
|
opacity: 0,
|
|
37006
36947
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
37007
36948
|
zIndex: 1
|
|
37008
|
-
} }), (0,
|
|
36949
|
+
} }), (0, import_jsx_runtime15.jsx)("div", { style: {
|
|
37009
36950
|
position: "absolute",
|
|
37010
36951
|
left: `calc(${percentage}% - 10px)`,
|
|
37011
36952
|
width: "20px",
|
|
@@ -37054,7 +36995,7 @@ var sizeStyles4 = {
|
|
|
37054
36995
|
lg: { padding: "4px 10px", fontSize: "var(--ggui-font-size-sm, 14px)" }
|
|
37055
36996
|
};
|
|
37056
36997
|
function Badge({ children, variant = "default", size = "md", pill = true, style, className }) {
|
|
37057
|
-
return (0,
|
|
36998
|
+
return (0, import_jsx_runtime16.jsx)("span", { className, style: {
|
|
37058
36999
|
...variantStyles2[variant],
|
|
37059
37000
|
...sizeStyles4[size],
|
|
37060
37001
|
display: "inline-flex",
|
|
@@ -37081,7 +37022,7 @@ function Skeleton({ variant = "rect", width, height, radius: radius2 = "sm", sty
|
|
|
37081
37022
|
animation: "ggui-skeleton-pulse 1.5s ease-in-out infinite",
|
|
37082
37023
|
...style
|
|
37083
37024
|
};
|
|
37084
|
-
return (0,
|
|
37025
|
+
return (0, import_jsx_runtime17.jsx)("div", { className, style: composedStyle, "aria-hidden": "true", children: (0, import_jsx_runtime17.jsx)("style", { children: `@keyframes ggui-skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }` }) });
|
|
37085
37026
|
}
|
|
37086
37027
|
var sizeMap2 = {
|
|
37087
37028
|
xs: 24,
|
|
@@ -37098,7 +37039,7 @@ var avatarColors = [
|
|
|
37098
37039
|
"var(--ggui-color-info-500, #06b6d4)"
|
|
37099
37040
|
];
|
|
37100
37041
|
function Avatar({ src, name, size = "md", shape = "circle", style, className }) {
|
|
37101
|
-
const [imageError, setImageError] = (0,
|
|
37042
|
+
const [imageError, setImageError] = (0, import_react18.useState)(false);
|
|
37102
37043
|
const resolvedSize = typeof size === "number" ? size : sizeMap2[size] || 40;
|
|
37103
37044
|
const initials = name ? name.split(" ").map((n) => n[0]).join("").toUpperCase().slice(0, 2) : "?";
|
|
37104
37045
|
const getColorFromName = (name2) => {
|
|
@@ -37108,7 +37049,7 @@ function Avatar({ src, name, size = "md", shape = "circle", style, className })
|
|
|
37108
37049
|
return avatarColors[hash2 % avatarColors.length];
|
|
37109
37050
|
};
|
|
37110
37051
|
const showInitials = !src || imageError;
|
|
37111
|
-
return (0,
|
|
37052
|
+
return (0, import_jsx_runtime18.jsx)("div", { role: "img", "aria-label": name || "Avatar", className, style: {
|
|
37112
37053
|
width: resolvedSize,
|
|
37113
37054
|
height: resolvedSize,
|
|
37114
37055
|
borderRadius: shape === "circle" ? "50%" : "var(--ggui-shape-radius-md, 8px)",
|
|
@@ -37122,7 +37063,7 @@ function Avatar({ src, name, size = "md", shape = "circle", style, className })
|
|
|
37122
37063
|
overflow: "hidden",
|
|
37123
37064
|
flexShrink: 0,
|
|
37124
37065
|
...style
|
|
37125
|
-
}, children: showInitials ? initials : (0,
|
|
37066
|
+
}, children: showInitials ? initials : (0, import_jsx_runtime18.jsx)("img", { src, alt: name || "Avatar", onError: () => setImageError(true), style: {
|
|
37126
37067
|
width: "100%",
|
|
37127
37068
|
height: "100%",
|
|
37128
37069
|
objectFit: "cover"
|
|
@@ -37155,14 +37096,14 @@ var variantStyles3 = {
|
|
|
37155
37096
|
}
|
|
37156
37097
|
};
|
|
37157
37098
|
var defaultIcons = {
|
|
37158
|
-
info: (0,
|
|
37159
|
-
success: (0,
|
|
37160
|
-
warning: (0,
|
|
37161
|
-
error: (0,
|
|
37099
|
+
info: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
37100
|
+
success: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
37101
|
+
warning: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
37102
|
+
error: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
37162
37103
|
};
|
|
37163
37104
|
function Alert({ children, variant = "info", title, closable, onClose, icon, style, className }) {
|
|
37164
37105
|
const variantStyle = variantStyles3[variant];
|
|
37165
|
-
return (0,
|
|
37106
|
+
return (0, import_jsx_runtime19.jsxs)("div", { role: "alert", className, style: {
|
|
37166
37107
|
display: "flex",
|
|
37167
37108
|
gap: "12px",
|
|
37168
37109
|
padding: "12px 16px",
|
|
@@ -37171,10 +37112,10 @@ function Alert({ children, variant = "info", title, closable, onClose, icon, sty
|
|
|
37171
37112
|
border: `1px solid ${variantStyle.border}`,
|
|
37172
37113
|
color: variantStyle.text,
|
|
37173
37114
|
...style
|
|
37174
|
-
}, children: [(0,
|
|
37115
|
+
}, children: [(0, import_jsx_runtime19.jsx)("div", { style: { color: variantStyle.icon, flexShrink: 0 }, children: icon || defaultIcons[variant] }), (0, import_jsx_runtime19.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-1, 4px)" }, children: [title && (0, import_jsx_runtime19.jsx)("div", { style: {
|
|
37175
37116
|
fontWeight: "var(--ggui-font-weight-semibold, 600)",
|
|
37176
37117
|
fontSize: "var(--ggui-font-size-sm, 14px)"
|
|
37177
|
-
}, children: title }), (0,
|
|
37118
|
+
}, children: title }), (0, import_jsx_runtime19.jsx)("div", { style: { fontSize: "var(--ggui-font-size-sm, 14px)" }, children })] }), closable && (0, import_jsx_runtime19.jsx)("button", { onClick: onClose, "aria-label": "Close", style: {
|
|
37178
37119
|
background: "none",
|
|
37179
37120
|
border: "none",
|
|
37180
37121
|
padding: "4px",
|
|
@@ -37189,7 +37130,7 @@ function Alert({ children, variant = "info", title, closable, onClose, icon, sty
|
|
|
37189
37130
|
alignItems: "center",
|
|
37190
37131
|
justifyContent: "center",
|
|
37191
37132
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)"
|
|
37192
|
-
}, children: (0,
|
|
37133
|
+
}, children: (0, import_jsx_runtime19.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime19.jsx)("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] });
|
|
37193
37134
|
}
|
|
37194
37135
|
var variantColors = {
|
|
37195
37136
|
default: "var(--ggui-color-primary-600, #0284c7)",
|
|
@@ -37207,17 +37148,17 @@ function Progress({ value, max = 100, variant = "default", size = "md", label, s
|
|
|
37207
37148
|
const height = sizeHeights[size];
|
|
37208
37149
|
const barColor = variantColors[variant];
|
|
37209
37150
|
const accessibleName = label ?? "Progress";
|
|
37210
|
-
return (0,
|
|
37151
|
+
return (0, import_jsx_runtime20.jsxs)("div", { className, style: { display: "flex", flexDirection: "column", gap: "var(--ggui-spacing-1, 4px)", ...style }, children: [showLabel && (0, import_jsx_runtime20.jsxs)("div", { style: { display: "flex", justifyContent: "space-between", alignItems: "center" }, children: [(0, import_jsx_runtime20.jsx)("span", { style: { fontSize: "var(--ggui-font-size-sm, 14px)", color: "var(--ggui-color-onSurfaceVariant, #52525b)" }, children: accessibleName }), (0, import_jsx_runtime20.jsxs)("span", { style: {
|
|
37211
37152
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
37212
37153
|
fontWeight: "var(--ggui-font-weight-medium, 500)",
|
|
37213
37154
|
color: "var(--ggui-color-onSurface, #18181b)"
|
|
37214
|
-
}, children: [Math.round(percentage), "%"] })] }), (0,
|
|
37155
|
+
}, children: [Math.round(percentage), "%"] })] }), (0, import_jsx_runtime20.jsxs)("div", { role: "progressbar", "aria-valuenow": indeterminate ? void 0 : value, "aria-valuemin": 0, "aria-valuemax": max, "aria-label": accessibleName, style: {
|
|
37215
37156
|
width: "100%",
|
|
37216
37157
|
height,
|
|
37217
37158
|
borderRadius: height / 2,
|
|
37218
37159
|
backgroundColor: "var(--ggui-color-outlineVariant, #e4e4e7)",
|
|
37219
37160
|
overflow: "hidden"
|
|
37220
|
-
}, children: [(0,
|
|
37161
|
+
}, children: [(0, import_jsx_runtime20.jsx)("div", { style: {
|
|
37221
37162
|
height: "100%",
|
|
37222
37163
|
borderRadius: height / 2,
|
|
37223
37164
|
backgroundColor: barColor,
|
|
@@ -37228,23 +37169,23 @@ function Progress({ value, max = 100, variant = "default", size = "md", label, s
|
|
|
37228
37169
|
} : {
|
|
37229
37170
|
width: `${percentage}%`
|
|
37230
37171
|
}
|
|
37231
|
-
} }), indeterminate && (0,
|
|
37172
|
+
} }), indeterminate && (0, import_jsx_runtime20.jsx)("style", { children: `@keyframes ggui-progress-indeterminate {
|
|
37232
37173
|
0% { transform: translateX(-100%); }
|
|
37233
37174
|
100% { transform: translateX(400%); }
|
|
37234
37175
|
}` })] })] });
|
|
37235
37176
|
}
|
|
37236
37177
|
function Image({ src, alt, width, height, objectFit = "cover", radius: radius2, fallback, style, className }) {
|
|
37237
|
-
const [error210, setError] = (0,
|
|
37178
|
+
const [error210, setError] = (0, import_react19.useState)(false);
|
|
37238
37179
|
const resolveSize2 = (value) => {
|
|
37239
37180
|
if (value === void 0)
|
|
37240
37181
|
return void 0;
|
|
37241
37182
|
return typeof value === "number" ? `${value}px` : value;
|
|
37242
37183
|
};
|
|
37243
37184
|
if (error210 && fallback) {
|
|
37244
|
-
return (0,
|
|
37185
|
+
return (0, import_jsx_runtime21.jsx)(import_jsx_runtime21.Fragment, { children: fallback });
|
|
37245
37186
|
}
|
|
37246
37187
|
if (error210) {
|
|
37247
|
-
return (0,
|
|
37188
|
+
return (0, import_jsx_runtime21.jsx)("div", { role: "img", "aria-label": `${alt} (failed to load)`, className, style: {
|
|
37248
37189
|
width: resolveSize2(width) || "100%",
|
|
37249
37190
|
height: resolveSize2(height) || "auto",
|
|
37250
37191
|
borderRadius: resolveRadius(radius2),
|
|
@@ -37254,9 +37195,9 @@ function Image({ src, alt, width, height, objectFit = "cover", radius: radius2,
|
|
|
37254
37195
|
justifyContent: "center",
|
|
37255
37196
|
color: "var(--ggui-color-outline, #d4d4d8)",
|
|
37256
37197
|
...style
|
|
37257
|
-
}, children: (0,
|
|
37198
|
+
}, children: (0, import_jsx_runtime21.jsx)("svg", { width: "48", height: "48", viewBox: "0 0 24 24", fill: "currentColor", children: (0, import_jsx_runtime21.jsx)("path", { d: "M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z" }) }) });
|
|
37258
37199
|
}
|
|
37259
|
-
return (0,
|
|
37200
|
+
return (0, import_jsx_runtime21.jsx)("img", { src, alt, onError: () => setError(true), className, style: {
|
|
37260
37201
|
width: resolveSize2(width) || "100%",
|
|
37261
37202
|
height: resolveSize2(height) || "auto",
|
|
37262
37203
|
objectFit,
|
|
@@ -41247,7 +41188,7 @@ function resolveLucideName(name) {
|
|
|
41247
41188
|
return LUCIDE_LOOKUP.get(normalized);
|
|
41248
41189
|
}
|
|
41249
41190
|
function renderLucideIcon(data, size, color) {
|
|
41250
|
-
return (0,
|
|
41191
|
+
return (0, import_jsx_runtime22.jsx)("svg", { width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: data.map(([tag, attrs], i) => import_react20.default.createElement(tag, { key: i, ...attrs })) });
|
|
41251
41192
|
}
|
|
41252
41193
|
function Icon({ name, size = 24, tone, children, style, className, "aria-label": ariaLabel }) {
|
|
41253
41194
|
const iconColor = tone ? resolveToneCss(tone) : "currentColor";
|
|
@@ -41262,22 +41203,22 @@ function Icon({ name, size = 24, tone, children, style, className, "aria-label":
|
|
|
41262
41203
|
...style
|
|
41263
41204
|
};
|
|
41264
41205
|
if (children) {
|
|
41265
|
-
return (0,
|
|
41206
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, style: wrapStyle, ...a11yProps, children });
|
|
41266
41207
|
}
|
|
41267
41208
|
if (name) {
|
|
41268
41209
|
const lucideKey = resolveLucideName(name);
|
|
41269
41210
|
if (lucideKey) {
|
|
41270
|
-
return (0,
|
|
41211
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, style: wrapStyle, ...a11yProps, children: renderLucideIcon(LUCIDE_ICONS[lucideKey], size, iconColor) });
|
|
41271
41212
|
}
|
|
41272
41213
|
}
|
|
41273
41214
|
if (name && /[^\x00-\x7F]/.test(name)) {
|
|
41274
|
-
return (0,
|
|
41215
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, ...a11yProps, style: {
|
|
41275
41216
|
...wrapStyle,
|
|
41276
41217
|
fontSize: size * 0.75,
|
|
41277
41218
|
lineHeight: 1
|
|
41278
41219
|
}, children: name });
|
|
41279
41220
|
}
|
|
41280
|
-
return (0,
|
|
41221
|
+
return (0, import_jsx_runtime22.jsx)("span", { className, ...a11yProps, style: {
|
|
41281
41222
|
...wrapStyle,
|
|
41282
41223
|
backgroundColor: "var(--ggui-color-outlineVariant, #e4e4e7)",
|
|
41283
41224
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)",
|
|
@@ -41292,7 +41233,7 @@ function Link({ children, href, external, tone, underline = "hover", style, clas
|
|
|
41292
41233
|
hover: "none",
|
|
41293
41234
|
none: "none"
|
|
41294
41235
|
}[underline];
|
|
41295
|
-
return (0,
|
|
41236
|
+
return (0, import_jsx_runtime23.jsxs)("a", { href, target: external ? "_blank" : void 0, rel: external ? "noopener noreferrer" : void 0, className, style: {
|
|
41296
41237
|
color: linkColor,
|
|
41297
41238
|
textDecoration: underlineStyle,
|
|
41298
41239
|
cursor: "pointer",
|
|
@@ -41306,13 +41247,13 @@ function Link({ children, href, external, tone, underline = "hover", style, clas
|
|
|
41306
41247
|
if (underline === "hover") {
|
|
41307
41248
|
e.target.style.textDecoration = "none";
|
|
41308
41249
|
}
|
|
41309
|
-
}, ...rest, children: [children, external && (0,
|
|
41250
|
+
}, ...rest, children: [children, external && (0, import_jsx_runtime23.jsxs)("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { marginLeft: "4px", verticalAlign: "middle" }, children: [(0, import_jsx_runtime23.jsx)("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" }), (0, import_jsx_runtime23.jsx)("polyline", { points: "15 3 21 3 21 9" }), (0, import_jsx_runtime23.jsx)("line", { x1: "10", y1: "14", x2: "21", y2: "3" })] })] });
|
|
41310
41251
|
}
|
|
41311
41252
|
function Tooltip({ children, content, position = "top", delay = 200, style, className }) {
|
|
41312
|
-
const [visible, setVisible] = (0,
|
|
41313
|
-
const [coords, setCoords] = (0,
|
|
41314
|
-
const triggerRef = (0,
|
|
41315
|
-
const timeoutRef = (0,
|
|
41253
|
+
const [visible, setVisible] = (0, import_react21.useState)(false);
|
|
41254
|
+
const [coords, setCoords] = (0, import_react21.useState)({ top: 0, left: 0 });
|
|
41255
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
41256
|
+
const timeoutRef = (0, import_react21.useRef)(null);
|
|
41316
41257
|
const showTooltip = () => {
|
|
41317
41258
|
timeoutRef.current = setTimeout(() => {
|
|
41318
41259
|
setVisible(true);
|
|
@@ -41324,7 +41265,7 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41324
41265
|
}
|
|
41325
41266
|
setVisible(false);
|
|
41326
41267
|
};
|
|
41327
|
-
(0,
|
|
41268
|
+
(0, import_react21.useEffect)(() => {
|
|
41328
41269
|
if (visible && triggerRef.current) {
|
|
41329
41270
|
const rect = triggerRef.current.getBoundingClientRect();
|
|
41330
41271
|
const offset = 8;
|
|
@@ -41351,7 +41292,7 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41351
41292
|
setCoords({ top, left });
|
|
41352
41293
|
}
|
|
41353
41294
|
}, [visible, position]);
|
|
41354
|
-
(0,
|
|
41295
|
+
(0, import_react21.useEffect)(() => {
|
|
41355
41296
|
return () => {
|
|
41356
41297
|
if (timeoutRef.current) {
|
|
41357
41298
|
clearTimeout(timeoutRef.current);
|
|
@@ -41370,10 +41311,10 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41370
41311
|
return "translateY(-50%)";
|
|
41371
41312
|
}
|
|
41372
41313
|
};
|
|
41373
|
-
return (0,
|
|
41314
|
+
return (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [(0, import_jsx_runtime24.jsx)("div", { ref: triggerRef, onMouseEnter: showTooltip, onMouseLeave: hideTooltip, onFocus: showTooltip, onBlur: hideTooltip, className, style: {
|
|
41374
41315
|
display: "inline-block",
|
|
41375
41316
|
...style
|
|
41376
|
-
}, children }), visible && (0,
|
|
41317
|
+
}, children }), visible && (0, import_jsx_runtime24.jsx)("div", { role: "tooltip", style: {
|
|
41377
41318
|
position: "fixed",
|
|
41378
41319
|
top: coords.top,
|
|
41379
41320
|
left: coords.left,
|
|
@@ -41389,16 +41330,16 @@ function Tooltip({ children, content, position = "top", delay = 200, style, clas
|
|
|
41389
41330
|
whiteSpace: "nowrap"
|
|
41390
41331
|
}, children: content })] });
|
|
41391
41332
|
}
|
|
41392
|
-
var sortIndicator = (active, direction) => (0,
|
|
41333
|
+
var sortIndicator = (active, direction) => (0, import_jsx_runtime25.jsxs)("span", { "aria-hidden": "true", style: {
|
|
41393
41334
|
display: "inline-flex",
|
|
41394
41335
|
flexDirection: "column",
|
|
41395
41336
|
marginLeft: "4px",
|
|
41396
41337
|
fontSize: "10px",
|
|
41397
41338
|
lineHeight: 1,
|
|
41398
41339
|
opacity: active ? 1 : 0.3
|
|
41399
|
-
}, children: [(0,
|
|
41340
|
+
}, children: [(0, import_jsx_runtime25.jsx)("span", { style: { opacity: active && direction === "asc" ? 1 : 0.4 }, children: "\u25B2" }), (0, import_jsx_runtime25.jsx)("span", { style: { opacity: active && direction === "desc" ? 1 : 0.4 }, children: "\u25BC" })] });
|
|
41400
41341
|
function Table({ columns, data, sortKey, sortDirection = "asc", onSort, striped = false, hoverable = true, compact = false, bordered = false, caption, style, className }) {
|
|
41401
|
-
const [hoveredRow, setHoveredRow] = (0,
|
|
41342
|
+
const [hoveredRow, setHoveredRow] = (0, import_react22.useState)(null);
|
|
41402
41343
|
const cellPadding = compact ? "var(--ggui-spacing-1, 4px) var(--ggui-spacing-2, 8px)" : "var(--ggui-spacing-2, 8px) var(--ggui-spacing-4, 16px)";
|
|
41403
41344
|
const handleSort = (key) => {
|
|
41404
41345
|
if (!onSort)
|
|
@@ -41406,7 +41347,7 @@ function Table({ columns, data, sortKey, sortDirection = "asc", onSort, striped
|
|
|
41406
41347
|
const newDirection = sortKey === key && sortDirection === "asc" ? "desc" : "asc";
|
|
41407
41348
|
onSort(key, newDirection);
|
|
41408
41349
|
};
|
|
41409
|
-
const
|
|
41350
|
+
const headerStyle = {
|
|
41410
41351
|
padding: cellPadding,
|
|
41411
41352
|
textAlign: "left",
|
|
41412
41353
|
fontWeight: "var(--ggui-font-weight-semibold, 600)",
|
|
@@ -41418,36 +41359,36 @@ function Table({ columns, data, sortKey, sortDirection = "asc", onSort, striped
|
|
|
41418
41359
|
whiteSpace: "nowrap",
|
|
41419
41360
|
userSelect: "none"
|
|
41420
41361
|
};
|
|
41421
|
-
return (0,
|
|
41362
|
+
return (0, import_jsx_runtime25.jsx)("div", { className, style: {
|
|
41422
41363
|
overflowX: "auto",
|
|
41423
41364
|
borderRadius: "var(--ggui-shape-radius-lg, 8px)",
|
|
41424
41365
|
border: bordered ? "1px solid var(--ggui-color-outlineVariant, #e4e4e7)" : void 0,
|
|
41425
41366
|
...style
|
|
41426
|
-
}, children: (0,
|
|
41367
|
+
}, children: (0, import_jsx_runtime25.jsxs)("table", { role: "table", style: {
|
|
41427
41368
|
width: "100%",
|
|
41428
41369
|
borderCollapse: "collapse",
|
|
41429
41370
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
41430
41371
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)"
|
|
41431
|
-
}, children: [caption && (0,
|
|
41372
|
+
}, children: [caption && (0, import_jsx_runtime25.jsx)("caption", { style: {
|
|
41432
41373
|
padding: cellPadding,
|
|
41433
41374
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
41434
41375
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)",
|
|
41435
41376
|
textAlign: "left",
|
|
41436
41377
|
captionSide: "top"
|
|
41437
|
-
}, children: caption }), (0,
|
|
41378
|
+
}, children: caption }), (0, import_jsx_runtime25.jsx)("thead", { children: (0, import_jsx_runtime25.jsx)("tr", { children: columns.map((col) => (0, import_jsx_runtime25.jsx)("th", { scope: "col", "aria-sort": sortKey === col.key ? sortDirection === "asc" ? "ascending" : "descending" : void 0, onClick: col.sortable ? () => handleSort(col.key) : void 0, onKeyDown: col.sortable ? (e) => {
|
|
41438
41379
|
if (e.key === "Enter" || e.key === " ") {
|
|
41439
41380
|
e.preventDefault();
|
|
41440
41381
|
handleSort(col.key);
|
|
41441
41382
|
}
|
|
41442
41383
|
} : void 0, tabIndex: col.sortable ? 0 : void 0, style: {
|
|
41443
|
-
...
|
|
41384
|
+
...headerStyle,
|
|
41444
41385
|
textAlign: col.align || "left",
|
|
41445
41386
|
width: col.width,
|
|
41446
41387
|
cursor: col.sortable ? "pointer" : "default"
|
|
41447
|
-
}, children: (0,
|
|
41388
|
+
}, children: (0, import_jsx_runtime25.jsxs)("span", { style: { display: "inline-flex", alignItems: "center" }, children: [col.header, col.sortable && sortIndicator(sortKey === col.key, sortDirection)] }) }, col.key)) }) }), (0, import_jsx_runtime25.jsx)("tbody", { children: data.map((row, rowIndex) => (0, import_jsx_runtime25.jsx)("tr", { onMouseEnter: hoverable ? () => setHoveredRow(rowIndex) : void 0, onMouseLeave: hoverable ? () => setHoveredRow(null) : void 0, style: {
|
|
41448
41389
|
backgroundColor: hoverable && hoveredRow === rowIndex ? "var(--ggui-color-surface, #fafafa)" : striped && rowIndex % 2 === 1 ? "var(--ggui-color-surface, #fafafa)" : "transparent",
|
|
41449
41390
|
transition: "background-color 0.15s ease"
|
|
41450
|
-
}, children: columns.map((col) => (0,
|
|
41391
|
+
}, children: columns.map((col) => (0, import_jsx_runtime25.jsx)("td", { style: {
|
|
41451
41392
|
padding: cellPadding,
|
|
41452
41393
|
textAlign: col.align || "left",
|
|
41453
41394
|
borderBottom: "1px solid var(--ggui-color-surfaceVariant, #f4f4f5)",
|
|
@@ -41469,10 +41410,10 @@ var sizeStyles5 = {
|
|
|
41469
41410
|
}
|
|
41470
41411
|
};
|
|
41471
41412
|
function Tabs({ items, activeKey, onChange, variant = "line", size = "md", fullWidth = false, style, className }) {
|
|
41472
|
-
const uniqueId = (0,
|
|
41473
|
-
const [internalKey, setInternalKey] = (0,
|
|
41413
|
+
const uniqueId = (0, import_react23.useId)();
|
|
41414
|
+
const [internalKey, setInternalKey] = (0, import_react23.useState)(items[0]?.key);
|
|
41474
41415
|
const currentKey = activeKey ?? internalKey;
|
|
41475
|
-
const handleChange = (0,
|
|
41416
|
+
const handleChange = (0, import_react23.useCallback)((key) => {
|
|
41476
41417
|
if (onChange) {
|
|
41477
41418
|
onChange(key);
|
|
41478
41419
|
} else {
|
|
@@ -41480,8 +41421,8 @@ function Tabs({ items, activeKey, onChange, variant = "line", size = "md", fullW
|
|
|
41480
41421
|
}
|
|
41481
41422
|
}, [onChange]);
|
|
41482
41423
|
const activeItem = items.find((item) => item.key === currentKey);
|
|
41483
|
-
const tabListRef = (0,
|
|
41484
|
-
const handleTabKeyDown = (0,
|
|
41424
|
+
const tabListRef = (0, import_react23.useRef)(null);
|
|
41425
|
+
const handleTabKeyDown = (0, import_react23.useCallback)((e) => {
|
|
41485
41426
|
const enabledItems = items.filter((item) => !item.disabled);
|
|
41486
41427
|
const currentIndex = enabledItems.findIndex((item) => item.key === currentKey);
|
|
41487
41428
|
let nextIndex;
|
|
@@ -41555,11 +41496,11 @@ function Tabs({ items, activeKey, onChange, variant = "line", size = "md", fullW
|
|
|
41555
41496
|
borderRadius: variant === "pills" ? "var(--ggui-shape-radius-lg, 8px)" : void 0,
|
|
41556
41497
|
padding: variant === "pills" ? "var(--ggui-spacing-1, 4px)" : void 0
|
|
41557
41498
|
};
|
|
41558
|
-
return (0,
|
|
41499
|
+
return (0, import_jsx_runtime26.jsxs)("div", { className, style, children: [(0, import_jsx_runtime26.jsx)("div", { ref: tabListRef, role: "tablist", "aria-orientation": "horizontal", style: tabListStyle, children: items.map((item) => {
|
|
41559
41500
|
const isActive = item.key === currentKey;
|
|
41560
41501
|
const isDisabled = !!item.disabled;
|
|
41561
|
-
return (0,
|
|
41562
|
-
}) }), activeItem && (0,
|
|
41502
|
+
return (0, import_jsx_runtime26.jsxs)("button", { role: "tab", id: `${uniqueId}-tab-${item.key}`, "aria-selected": isActive, "aria-controls": `${uniqueId}-panel-${item.key}`, "aria-disabled": isDisabled, tabIndex: isActive ? 0 : -1, onClick: isDisabled ? void 0 : () => handleChange(item.key), onKeyDown: isDisabled ? void 0 : handleTabKeyDown, style: getTabStyle(isActive, isDisabled), children: [item.icon, item.label] }, item.key);
|
|
41503
|
+
}) }), activeItem && (0, import_jsx_runtime26.jsx)("div", { role: "tabpanel", id: `${uniqueId}-panel-${activeItem.key}`, "aria-labelledby": `${uniqueId}-tab-${activeItem.key}`, tabIndex: 0, style: {
|
|
41563
41504
|
padding: "var(--ggui-spacing-4, 16px) 0"
|
|
41564
41505
|
}, children: activeItem.content })] });
|
|
41565
41506
|
}
|
|
@@ -41739,20 +41680,20 @@ var variantStyles4 = {
|
|
|
41739
41680
|
}
|
|
41740
41681
|
};
|
|
41741
41682
|
var defaultIcons2 = {
|
|
41742
|
-
info: (0,
|
|
41743
|
-
success: (0,
|
|
41744
|
-
warning: (0,
|
|
41745
|
-
error: (0,
|
|
41683
|
+
info: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z", clipRule: "evenodd" }) }),
|
|
41684
|
+
success: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z", clipRule: "evenodd" }) }),
|
|
41685
|
+
warning: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z", clipRule: "evenodd" }) }),
|
|
41686
|
+
error: (0, import_jsx_runtime27.jsx)("svg", { width: "20", height: "20", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z", clipRule: "evenodd" }) })
|
|
41746
41687
|
};
|
|
41747
41688
|
function Toast({ message, variant = "info", title, duration: duration22 = 5e3, onClose, visible = true, style, className }) {
|
|
41748
|
-
(0,
|
|
41689
|
+
(0, import_react24.useEffect)(() => {
|
|
41749
41690
|
if (!visible || duration22 === 0 || !onClose)
|
|
41750
41691
|
return;
|
|
41751
41692
|
const timer = setTimeout(onClose, duration22);
|
|
41752
41693
|
return () => clearTimeout(timer);
|
|
41753
41694
|
}, [visible, duration22, onClose]);
|
|
41754
41695
|
if (!visible) {
|
|
41755
|
-
return (0,
|
|
41696
|
+
return (0, import_jsx_runtime27.jsx)("div", { role: "alert", "aria-live": "assertive", className, style: {
|
|
41756
41697
|
position: "absolute",
|
|
41757
41698
|
width: "1px",
|
|
41758
41699
|
height: "1px",
|
|
@@ -41777,10 +41718,10 @@ function Toast({ message, variant = "info", title, duration: duration22 = 5e3, o
|
|
|
41777
41718
|
animation: animation.slideInUp,
|
|
41778
41719
|
...style
|
|
41779
41720
|
};
|
|
41780
|
-
return (0,
|
|
41721
|
+
return (0, import_jsx_runtime27.jsxs)("div", { role: "alert", "aria-live": "assertive", className, style: toastStyle, children: [(0, import_jsx_runtime27.jsx)("div", { style: { color: vs.icon, flexShrink: 0, marginTop: "2px" }, children: defaultIcons2[variant] }), (0, import_jsx_runtime27.jsxs)("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "2px" }, children: [title && (0, import_jsx_runtime27.jsx)("div", { style: {
|
|
41781
41722
|
fontWeight: "var(--ggui-font-weight-semibold, 600)",
|
|
41782
41723
|
fontSize: "var(--ggui-font-size-sm, 14px)"
|
|
41783
|
-
}, children: title }), (0,
|
|
41724
|
+
}, children: title }), (0, import_jsx_runtime27.jsx)("div", { style: { fontSize: "var(--ggui-font-size-sm, 14px)" }, children: message })] }), onClose && (0, import_jsx_runtime27.jsx)("button", { onClick: onClose, "aria-label": "Dismiss notification", style: {
|
|
41784
41725
|
background: "none",
|
|
41785
41726
|
border: "none",
|
|
41786
41727
|
padding: "4px",
|
|
@@ -41795,16 +41736,16 @@ function Toast({ message, variant = "info", title, duration: duration22 = 5e3, o
|
|
|
41795
41736
|
alignItems: "center",
|
|
41796
41737
|
justifyContent: "center",
|
|
41797
41738
|
borderRadius: "var(--ggui-shape-radius-sm, 4px)"
|
|
41798
|
-
}, children: (0,
|
|
41739
|
+
}, children: (0, import_jsx_runtime27.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "currentColor", children: (0, import_jsx_runtime27.jsx)("path", { fillRule: "evenodd", d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z", clipRule: "evenodd" }) }) })] });
|
|
41799
41740
|
}
|
|
41800
|
-
var chevron = (expanded) => (0,
|
|
41741
|
+
var chevron = (expanded) => (0, import_jsx_runtime28.jsx)("svg", { width: "16", height: "16", viewBox: "0 0 20 20", fill: "currentColor", "aria-hidden": "true", style: {
|
|
41801
41742
|
transition: `transform ${duration3.normal} ${easing.easeInOut}`,
|
|
41802
41743
|
transform: expanded ? "rotate(180deg)" : "rotate(0deg)",
|
|
41803
41744
|
flexShrink: 0
|
|
41804
|
-
}, children: (0,
|
|
41745
|
+
}, children: (0, import_jsx_runtime28.jsx)("path", { fillRule: "evenodd", d: "M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z", clipRule: "evenodd" }) });
|
|
41805
41746
|
function Accordion({ items, expandedKeys, onChange, multiple = false, variant = "default", style, className }) {
|
|
41806
|
-
const uniqueId = (0,
|
|
41807
|
-
const [internalExpanded, setInternalExpanded] = (0,
|
|
41747
|
+
const uniqueId = (0, import_react25.useId)();
|
|
41748
|
+
const [internalExpanded, setInternalExpanded] = (0, import_react25.useState)([]);
|
|
41808
41749
|
const currentExpanded = expandedKeys ?? internalExpanded;
|
|
41809
41750
|
const handleToggle = (key) => {
|
|
41810
41751
|
let newExpanded;
|
|
@@ -41852,12 +41793,12 @@ function Accordion({ items, expandedKeys, onChange, multiple = false, variant =
|
|
|
41852
41793
|
borderTop: isFirst ? "1px solid var(--ggui-color-outlineVariant, #e4e4e7)" : void 0
|
|
41853
41794
|
};
|
|
41854
41795
|
};
|
|
41855
|
-
return (0,
|
|
41796
|
+
return (0, import_jsx_runtime28.jsx)("div", { className, style: containerStyle, children: items.map((item, index) => {
|
|
41856
41797
|
const isExpanded = currentExpanded.includes(item.key);
|
|
41857
41798
|
const isDisabled = !!item.disabled;
|
|
41858
41799
|
const isFirst = index === 0;
|
|
41859
41800
|
const isLast = index === items.length - 1;
|
|
41860
|
-
return (0,
|
|
41801
|
+
return (0, import_jsx_runtime28.jsxs)("div", { style: getItemStyle(isFirst, isLast), children: [(0, import_jsx_runtime28.jsx)("h3", { style: { margin: 0 }, children: (0, import_jsx_runtime28.jsxs)("button", { id: `${uniqueId}-header-${item.key}`, "aria-expanded": isExpanded, "aria-controls": `${uniqueId}-panel-${item.key}`, "aria-disabled": isDisabled, onClick: isDisabled ? void 0 : () => handleToggle(item.key), style: {
|
|
41861
41802
|
display: "flex",
|
|
41862
41803
|
alignItems: "center",
|
|
41863
41804
|
justifyContent: "space-between",
|
|
@@ -41872,9 +41813,9 @@ function Accordion({ items, expandedKeys, onChange, multiple = false, variant =
|
|
|
41872
41813
|
color: "var(--ggui-color-onSurface, #18181b)",
|
|
41873
41814
|
textAlign: "left",
|
|
41874
41815
|
transition: `background-color ${duration3.fast} ${easing.easeInOut}`
|
|
41875
|
-
}, children: [(0,
|
|
41816
|
+
}, children: [(0, import_jsx_runtime28.jsx)("span", { children: item.title }), chevron(isExpanded)] }) }), (0, import_jsx_runtime28.jsx)("div", { id: `${uniqueId}-panel-${item.key}`, role: "region", "aria-labelledby": `${uniqueId}-header-${item.key}`, hidden: !isExpanded, style: {
|
|
41876
41817
|
overflow: "hidden"
|
|
41877
|
-
}, children: isExpanded && (0,
|
|
41818
|
+
}, children: isExpanded && (0, import_jsx_runtime28.jsx)("div", { style: {
|
|
41878
41819
|
padding: "0 var(--ggui-spacing-4, 16px) var(--ggui-spacing-4, 16px)",
|
|
41879
41820
|
fontSize: "var(--ggui-font-size-sm, 14px)",
|
|
41880
41821
|
color: "var(--ggui-color-onSurfaceVariant, #52525b)",
|
|
@@ -41884,7 +41825,7 @@ function Accordion({ items, expandedKeys, onChange, multiple = false, variant =
|
|
|
41884
41825
|
}
|
|
41885
41826
|
var STYLE_ID = "ggui-motion-keyframes";
|
|
41886
41827
|
function MotionKeyframes() {
|
|
41887
|
-
(0,
|
|
41828
|
+
(0, import_react26.useEffect)(() => {
|
|
41888
41829
|
if (document.getElementById(STYLE_ID))
|
|
41889
41830
|
return;
|
|
41890
41831
|
const styleEl = document.createElement("style");
|
|
@@ -41901,12 +41842,12 @@ function MotionKeyframes() {
|
|
|
41901
41842
|
return null;
|
|
41902
41843
|
}
|
|
41903
41844
|
function useMotion() {
|
|
41904
|
-
const [motionEnabled, setMotionEnabled] = (0,
|
|
41845
|
+
const [motionEnabled, setMotionEnabled] = (0, import_react26.useState)(() => {
|
|
41905
41846
|
if (typeof window === "undefined")
|
|
41906
41847
|
return true;
|
|
41907
41848
|
return !window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
41908
41849
|
});
|
|
41909
|
-
(0,
|
|
41850
|
+
(0, import_react26.useEffect)(() => {
|
|
41910
41851
|
const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
|
|
41911
41852
|
const handler = (e) => setMotionEnabled(!e.matches);
|
|
41912
41853
|
mq.addEventListener("change", handler);
|
|
@@ -41915,9 +41856,9 @@ function useMotion() {
|
|
|
41915
41856
|
return { motionEnabled };
|
|
41916
41857
|
}
|
|
41917
41858
|
function useAnimationKey(dep) {
|
|
41918
|
-
const [key, setKey] = (0,
|
|
41919
|
-
const isFirst = (0,
|
|
41920
|
-
(0,
|
|
41859
|
+
const [key, setKey] = (0, import_react26.useState)(0);
|
|
41860
|
+
const isFirst = (0, import_react26.useRef)(true);
|
|
41861
|
+
(0, import_react26.useEffect)(() => {
|
|
41921
41862
|
if (isFirst.current) {
|
|
41922
41863
|
isFirst.current = false;
|
|
41923
41864
|
return;
|
|
@@ -42055,7 +41996,7 @@ var colors = {
|
|
|
42055
41996
|
transparent: "transparent"
|
|
42056
41997
|
};
|
|
42057
41998
|
function SearchField({ value: controlledValue, onChange, onSearch, placeholder = "Search...", showButton = false, buttonText = "Search", loading, disabled, size = "md", style, className }) {
|
|
42058
|
-
const [internalValue, setInternalValue] = (0,
|
|
41999
|
+
const [internalValue, setInternalValue] = (0, import_react27.useState)("");
|
|
42059
42000
|
const value = controlledValue !== void 0 ? controlledValue : internalValue;
|
|
42060
42001
|
const handleChange = (newValue) => {
|
|
42061
42002
|
if (controlledValue === void 0) {
|
|
@@ -42076,12 +42017,12 @@ function SearchField({ value: controlledValue, onChange, onSearch, placeholder =
|
|
|
42076
42017
|
md: "md",
|
|
42077
42018
|
lg: "md"
|
|
42078
42019
|
};
|
|
42079
|
-
return (0,
|
|
42020
|
+
return (0, import_jsx_runtime29.jsxs)("div", { className, style: {
|
|
42080
42021
|
display: "flex",
|
|
42081
42022
|
gap: "8px",
|
|
42082
42023
|
alignItems: "flex-end",
|
|
42083
42024
|
...style
|
|
42084
|
-
}, children: [(0,
|
|
42025
|
+
}, children: [(0, import_jsx_runtime29.jsxs)("div", { style: { position: "relative", flex: 1 }, children: [(0, import_jsx_runtime29.jsx)("div", { style: {
|
|
42085
42026
|
position: "absolute",
|
|
42086
42027
|
left: "12px",
|
|
42087
42028
|
top: "50%",
|
|
@@ -42090,7 +42031,7 @@ function SearchField({ value: controlledValue, onChange, onSearch, placeholder =
|
|
|
42090
42031
|
pointerEvents: "none",
|
|
42091
42032
|
display: "flex",
|
|
42092
42033
|
alignItems: "center"
|
|
42093
|
-
}, children: loading ? (0,
|
|
42034
|
+
}, children: loading ? (0, import_jsx_runtime29.jsx)(Spinner, { size: 16 }) : (0, import_jsx_runtime29.jsx)(Icon, { name: "search", size: 16 }) }), (0, import_jsx_runtime29.jsx)("input", { type: "search", value, onChange: (e) => handleChange(e.target.value), onKeyDown: handleKeyDown, placeholder, disabled: disabled || loading, style: {
|
|
42094
42035
|
width: "100%",
|
|
42095
42036
|
padding: size === "sm" ? "6px 10px 6px 36px" : size === "lg" ? "12px 14px 12px 40px" : "10px 12px 10px 38px",
|
|
42096
42037
|
paddingLeft: "36px",
|
|
@@ -42101,24 +42042,24 @@ function SearchField({ value: controlledValue, onChange, onSearch, placeholder =
|
|
|
42101
42042
|
color: colors.gray[900],
|
|
42102
42043
|
outline: "none",
|
|
42103
42044
|
boxSizing: "border-box"
|
|
42104
|
-
} })] }), showButton && (0,
|
|
42045
|
+
} })] }), showButton && (0, import_jsx_runtime29.jsx)(Button, { onClick: handleSubmit, disabled: disabled || loading, size: buttonSizes[size], loading, children: buttonText })] });
|
|
42105
42046
|
}
|
|
42106
42047
|
function FormField({ label, children, error: error210, helperText, required: required2, description, style, className }) {
|
|
42107
42048
|
const hasError = Boolean(error210);
|
|
42108
|
-
return (0,
|
|
42049
|
+
return (0, import_jsx_runtime30.jsxs)("div", { className, style: {
|
|
42109
42050
|
display: "flex",
|
|
42110
42051
|
flexDirection: "column",
|
|
42111
42052
|
gap: "4px",
|
|
42112
42053
|
...style
|
|
42113
|
-
}, children: [(0,
|
|
42054
|
+
}, children: [(0, import_jsx_runtime30.jsxs)("label", { style: {
|
|
42114
42055
|
fontSize: fontSize.sm,
|
|
42115
42056
|
fontWeight: fontWeight.medium,
|
|
42116
42057
|
color: colors.gray[700]
|
|
42117
|
-
}, children: [label, required2 && (0,
|
|
42058
|
+
}, children: [label, required2 && (0, import_jsx_runtime30.jsx)("span", { style: { color: colors.error[500], marginLeft: "2px" }, children: "*" })] }), description && (0, import_jsx_runtime30.jsx)("span", { style: {
|
|
42118
42059
|
fontSize: fontSize.xs,
|
|
42119
42060
|
color: colors.gray[500],
|
|
42120
42061
|
marginBottom: "4px"
|
|
42121
|
-
}, children: description }), children, (error210 || helperText) && (0,
|
|
42062
|
+
}, children: description }), children, (error210 || helperText) && (0, import_jsx_runtime30.jsx)("span", { style: {
|
|
42122
42063
|
fontSize: fontSize.xs,
|
|
42123
42064
|
color: hasError ? colors.error[500] : colors.gray[500]
|
|
42124
42065
|
}, children: error210 || helperText })] });
|
|
@@ -42127,7 +42068,7 @@ function MenuItem({ label, icon, rightElement, onClick, disabled, active, danger
|
|
|
42127
42068
|
const baseColor = danger ? colors.error[600] : colors.gray[700];
|
|
42128
42069
|
const hoverBg = danger ? colors.error[50] : colors.gray[100];
|
|
42129
42070
|
const activeBg = danger ? colors.error[100] : colors.primary[50];
|
|
42130
|
-
return (0,
|
|
42071
|
+
return (0, import_jsx_runtime31.jsxs)("button", { onClick: disabled ? void 0 : onClick, disabled, className, style: {
|
|
42131
42072
|
display: "flex",
|
|
42132
42073
|
alignItems: "center",
|
|
42133
42074
|
gap: "8px",
|
|
@@ -42151,7 +42092,7 @@ function MenuItem({ label, icon, rightElement, onClick, disabled, active, danger
|
|
|
42151
42092
|
if (!disabled && !active) {
|
|
42152
42093
|
e.target.style.backgroundColor = "transparent";
|
|
42153
42094
|
}
|
|
42154
|
-
}, children: [icon && (0,
|
|
42095
|
+
}, children: [icon && (0, import_jsx_runtime31.jsx)("span", { style: { display: "flex", flexShrink: 0 }, children: icon }), (0, import_jsx_runtime31.jsx)("span", { style: { flex: 1 }, children: label }), rightElement && (0, import_jsx_runtime31.jsx)("span", { style: { display: "flex", flexShrink: 0, color: colors.gray[400] }, children: rightElement })] });
|
|
42155
42096
|
}
|
|
42156
42097
|
var variantStyles5 = {
|
|
42157
42098
|
default: {
|
|
@@ -42192,7 +42133,7 @@ var sizeStyles6 = {
|
|
|
42192
42133
|
};
|
|
42193
42134
|
function Tag({ children, variant = "default", size = "md", closable, onClose, icon, style, className }) {
|
|
42194
42135
|
const sizeStyle = sizeStyles6[size];
|
|
42195
|
-
return (0,
|
|
42136
|
+
return (0, import_jsx_runtime32.jsxs)("span", { className, style: {
|
|
42196
42137
|
display: "inline-flex",
|
|
42197
42138
|
alignItems: "center",
|
|
42198
42139
|
gap: sizeStyle.gap,
|
|
@@ -42202,7 +42143,7 @@ function Tag({ children, variant = "default", size = "md", closable, onClose, ic
|
|
|
42202
42143
|
borderRadius: "6px",
|
|
42203
42144
|
...variantStyles5[variant],
|
|
42204
42145
|
...style
|
|
42205
|
-
}, children: [icon && (0,
|
|
42146
|
+
}, children: [icon && (0, import_jsx_runtime32.jsx)("span", { style: { display: "flex" }, children: icon }), children, closable && (0, import_jsx_runtime32.jsx)("button", { onClick: onClose, style: {
|
|
42206
42147
|
display: "flex",
|
|
42207
42148
|
alignItems: "center",
|
|
42208
42149
|
justifyContent: "center",
|
|
@@ -42213,12 +42154,12 @@ function Tag({ children, variant = "default", size = "md", closable, onClose, ic
|
|
|
42213
42154
|
cursor: "pointer",
|
|
42214
42155
|
opacity: 0.7,
|
|
42215
42156
|
marginLeft: "2px"
|
|
42216
|
-
}, "aria-label": "Remove", children: (0,
|
|
42157
|
+
}, "aria-label": "Remove", children: (0, import_jsx_runtime32.jsx)("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "currentColor", children: (0, import_jsx_runtime32.jsx)("path", { d: "M9.5 3.205L8.795 2.5 6 5.295 3.205 2.5l-.705.705L5.295 6 2.5 8.795l.705.705L6 6.705 8.795 9.5l.705-.705L6.705 6 9.5 3.205z" }) }) })] });
|
|
42217
42158
|
}
|
|
42218
42159
|
function Dropdown({ trigger, options, value, onChange, placement = "bottom-start", disabled, style, className }) {
|
|
42219
|
-
const [isOpen, setIsOpen] = (0,
|
|
42220
|
-
const containerRef = (0,
|
|
42221
|
-
(0,
|
|
42160
|
+
const [isOpen, setIsOpen] = (0, import_react28.useState)(false);
|
|
42161
|
+
const containerRef = (0, import_react28.useRef)(null);
|
|
42162
|
+
(0, import_react28.useEffect)(() => {
|
|
42222
42163
|
const handleClickOutside = (event) => {
|
|
42223
42164
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
42224
42165
|
setIsOpen(false);
|
|
@@ -42229,7 +42170,7 @@ function Dropdown({ trigger, options, value, onChange, placement = "bottom-start
|
|
|
42229
42170
|
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
42230
42171
|
}
|
|
42231
42172
|
}, [isOpen]);
|
|
42232
|
-
(0,
|
|
42173
|
+
(0, import_react28.useEffect)(() => {
|
|
42233
42174
|
const handleEscape = (event) => {
|
|
42234
42175
|
if (event.key === "Escape") {
|
|
42235
42176
|
setIsOpen(false);
|
|
@@ -42258,11 +42199,11 @@ function Dropdown({ trigger, options, value, onChange, placement = "bottom-start
|
|
|
42258
42199
|
return { top: "100%", left: 0, marginTop: "4px" };
|
|
42259
42200
|
}
|
|
42260
42201
|
};
|
|
42261
|
-
return (0,
|
|
42202
|
+
return (0, import_jsx_runtime33.jsxs)("div", { ref: containerRef, className, style: {
|
|
42262
42203
|
position: "relative",
|
|
42263
42204
|
display: "inline-block",
|
|
42264
42205
|
...style
|
|
42265
|
-
}, children: [(0,
|
|
42206
|
+
}, children: [(0, import_jsx_runtime33.jsx)("div", { onClick: () => !disabled && setIsOpen(!isOpen), style: { cursor: disabled ? "not-allowed" : "pointer" }, children: trigger }), isOpen && (0, import_jsx_runtime33.jsx)("div", { style: {
|
|
42266
42207
|
position: "absolute",
|
|
42267
42208
|
...getMenuPosition(),
|
|
42268
42209
|
minWidth: "160px",
|
|
@@ -42272,19 +42213,19 @@ function Dropdown({ trigger, options, value, onChange, placement = "bottom-start
|
|
|
42272
42213
|
boxShadow: shadow.lg,
|
|
42273
42214
|
zIndex: zIndex.dropdown,
|
|
42274
42215
|
padding: "4px"
|
|
42275
|
-
}, children: options.map((option) => (0,
|
|
42216
|
+
}, children: options.map((option) => (0, import_jsx_runtime33.jsx)(MenuItem, { label: option.label, icon: option.icon, onClick: () => handleSelect(option.value), disabled: option.disabled, active: value === option.value, danger: option.danger }, option.value)) })] });
|
|
42276
42217
|
}
|
|
42277
42218
|
function Autocomplete({ value = "", onChange, onSelect, options, placeholder, label, loading, disabled, error: error210, noResultsText = "No results found", style, className }) {
|
|
42278
|
-
const [isOpen, setIsOpen] = (0,
|
|
42279
|
-
const [highlightedIndex, setHighlightedIndex] = (0,
|
|
42280
|
-
const containerRef = (0,
|
|
42281
|
-
const filteredOptions = (0,
|
|
42219
|
+
const [isOpen, setIsOpen] = (0, import_react29.useState)(false);
|
|
42220
|
+
const [highlightedIndex, setHighlightedIndex] = (0, import_react29.useState)(-1);
|
|
42221
|
+
const containerRef = (0, import_react29.useRef)(null);
|
|
42222
|
+
const filteredOptions = (0, import_react29.useMemo)(() => {
|
|
42282
42223
|
if (!value)
|
|
42283
42224
|
return options;
|
|
42284
42225
|
const lowerValue = value.toLowerCase();
|
|
42285
42226
|
return options.filter((opt) => opt.label.toLowerCase().includes(lowerValue) || opt.value.toLowerCase().includes(lowerValue));
|
|
42286
42227
|
}, [options, value]);
|
|
42287
|
-
(0,
|
|
42228
|
+
(0, import_react29.useEffect)(() => {
|
|
42288
42229
|
const handleClickOutside = (event) => {
|
|
42289
42230
|
if (containerRef.current && !containerRef.current.contains(event.target)) {
|
|
42290
42231
|
setIsOpen(false);
|
|
@@ -42332,10 +42273,10 @@ function Autocomplete({ value = "", onChange, onSelect, options, placeholder, la
|
|
|
42332
42273
|
break;
|
|
42333
42274
|
}
|
|
42334
42275
|
};
|
|
42335
|
-
return (0,
|
|
42276
|
+
return (0, import_jsx_runtime34.jsxs)("div", { ref: containerRef, className, style: {
|
|
42336
42277
|
position: "relative",
|
|
42337
42278
|
...style
|
|
42338
|
-
}, children: [(0,
|
|
42279
|
+
}, children: [(0, import_jsx_runtime34.jsx)("div", { onKeyDown: handleKeyDown, children: (0, import_jsx_runtime34.jsx)(Input, { label, value, onChange: handleInputChange, onFocus: () => setIsOpen(true), placeholder, disabled, error: error210 }) }), isOpen && (0, import_jsx_runtime34.jsx)("div", { style: {
|
|
42339
42280
|
position: "absolute",
|
|
42340
42281
|
top: "100%",
|
|
42341
42282
|
left: 0,
|
|
@@ -42348,12 +42289,12 @@ function Autocomplete({ value = "", onChange, onSelect, options, placeholder, la
|
|
|
42348
42289
|
zIndex: zIndex.dropdown,
|
|
42349
42290
|
maxHeight: "240px",
|
|
42350
42291
|
overflow: "auto"
|
|
42351
|
-
}, children: loading ? (0,
|
|
42292
|
+
}, children: loading ? (0, import_jsx_runtime34.jsx)("div", { style: { padding: "12px", display: "flex", justifyContent: "center" }, children: (0, import_jsx_runtime34.jsx)(Spinner, { size: 20 }) }) : filteredOptions.length === 0 ? (0, import_jsx_runtime34.jsx)("div", { style: {
|
|
42352
42293
|
padding: "12px",
|
|
42353
42294
|
textAlign: "center",
|
|
42354
42295
|
color: colors.gray[500],
|
|
42355
42296
|
fontSize: fontSize.sm
|
|
42356
|
-
}, children: noResultsText }) : filteredOptions.map((option, index) => (0,
|
|
42297
|
+
}, children: noResultsText }) : filteredOptions.map((option, index) => (0, import_jsx_runtime34.jsxs)("div", { onClick: () => !option.disabled && handleSelect(option), style: {
|
|
42357
42298
|
padding: "8px 12px",
|
|
42358
42299
|
cursor: option.disabled ? "not-allowed" : "pointer",
|
|
42359
42300
|
backgroundColor: highlightedIndex === index ? colors.gray[100] : "transparent",
|
|
@@ -42362,10 +42303,10 @@ function Autocomplete({ value = "", onChange, onSelect, options, placeholder, la
|
|
|
42362
42303
|
display: "flex",
|
|
42363
42304
|
alignItems: "center",
|
|
42364
42305
|
gap: "8px"
|
|
42365
|
-
}, onMouseEnter: () => setHighlightedIndex(index), children: [option.icon && (0,
|
|
42306
|
+
}, onMouseEnter: () => setHighlightedIndex(index), children: [option.icon && (0, import_jsx_runtime34.jsx)("span", { style: { flexShrink: 0 }, children: option.icon }), (0, import_jsx_runtime34.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime34.jsx)("div", { children: option.label }), option.description && (0, import_jsx_runtime34.jsx)("div", { style: { fontSize: fontSize.xs, color: colors.gray[500] }, children: option.description })] })] }, option.value)) })] });
|
|
42366
42307
|
}
|
|
42367
42308
|
function Breadcrumb({ items, separator = "/", onItemClick, style, className }) {
|
|
42368
|
-
return (0,
|
|
42309
|
+
return (0, import_jsx_runtime35.jsx)("nav", { "aria-label": "Breadcrumb", className, style: {
|
|
42369
42310
|
display: "flex",
|
|
42370
42311
|
alignItems: "center",
|
|
42371
42312
|
gap: "8px",
|
|
@@ -42373,19 +42314,19 @@ function Breadcrumb({ items, separator = "/", onItemClick, style, className }) {
|
|
|
42373
42314
|
...style
|
|
42374
42315
|
}, children: items.map((item, index) => {
|
|
42375
42316
|
const isLast = index === items.length - 1;
|
|
42376
|
-
return (0,
|
|
42317
|
+
return (0, import_jsx_runtime35.jsxs)(import_react30.Fragment, { children: [index > 0 && (0, import_jsx_runtime35.jsx)("span", { style: { color: colors.gray[400] }, children: separator }), item.icon && (0, import_jsx_runtime35.jsx)("span", { style: {
|
|
42377
42318
|
display: "flex",
|
|
42378
42319
|
alignItems: "center",
|
|
42379
42320
|
color: isLast ? colors.gray[900] : colors.gray[500]
|
|
42380
|
-
}, children: item.icon }), isLast ? (0,
|
|
42321
|
+
}, children: item.icon }), isLast ? (0, import_jsx_runtime35.jsx)("span", { style: {
|
|
42381
42322
|
color: colors.gray[900],
|
|
42382
42323
|
fontWeight: 500
|
|
42383
|
-
}, "aria-current": "page", children: item.label }) : item.href ? (0,
|
|
42324
|
+
}, "aria-current": "page", children: item.label }) : item.href ? (0, import_jsx_runtime35.jsx)(Link, { href: item.href, tone: "muted", underline: "hover", onClick: (e) => {
|
|
42384
42325
|
if (onItemClick) {
|
|
42385
42326
|
e.preventDefault();
|
|
42386
42327
|
onItemClick(item, index);
|
|
42387
42328
|
}
|
|
42388
|
-
}, children: item.label }) : (0,
|
|
42329
|
+
}, children: item.label }) : (0, import_jsx_runtime35.jsx)("button", { onClick: () => onItemClick?.(item, index), style: {
|
|
42389
42330
|
background: "none",
|
|
42390
42331
|
border: "none",
|
|
42391
42332
|
padding: 0,
|
|
@@ -42428,7 +42369,7 @@ function Pagination({ currentPage, totalPages, onPageChange, showFirstLast = tru
|
|
|
42428
42369
|
};
|
|
42429
42370
|
const buttonSize = size === "sm" ? "xs" : size === "lg" ? "md" : "sm";
|
|
42430
42371
|
const iconSize = size === "sm" ? 14 : size === "lg" ? 20 : 16;
|
|
42431
|
-
const PageButton = ({ page, active }) => (0,
|
|
42372
|
+
const PageButton = ({ page, active }) => (0, import_jsx_runtime36.jsx)("button", { onClick: () => !disabled && onPageChange?.(page), disabled, style: {
|
|
42432
42373
|
minWidth: size === "sm" ? "28px" : size === "lg" ? "40px" : "32px",
|
|
42433
42374
|
height: size === "sm" ? "28px" : size === "lg" ? "40px" : "32px",
|
|
42434
42375
|
padding: "0 8px",
|
|
@@ -42442,15 +42383,15 @@ function Pagination({ currentPage, totalPages, onPageChange, showFirstLast = tru
|
|
|
42442
42383
|
opacity: disabled ? 0.5 : 1,
|
|
42443
42384
|
transition: "all 0.15s"
|
|
42444
42385
|
}, children: page });
|
|
42445
|
-
return (0,
|
|
42386
|
+
return (0, import_jsx_runtime36.jsxs)("nav", { "aria-label": "Pagination", className, style: {
|
|
42446
42387
|
display: "flex",
|
|
42447
42388
|
alignItems: "center",
|
|
42448
42389
|
gap: "4px",
|
|
42449
42390
|
...style
|
|
42450
|
-
}, children: [showFirstLast && (0,
|
|
42391
|
+
}, children: [showFirstLast && (0, import_jsx_runtime36.jsxs)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(1), disabled: disabled || currentPage === 1, "aria-label": "First page", children: [(0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-left", size: iconSize }), (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-left", size: iconSize, style: { marginLeft: "-8px" } })] }), (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(currentPage - 1), disabled: disabled || currentPage === 1, "aria-label": "Previous page", children: (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-left", size: iconSize }) }), getVisiblePages().map((page, index) => page === "ellipsis" ? (0, import_jsx_runtime36.jsx)("span", { style: {
|
|
42451
42392
|
padding: "0 4px",
|
|
42452
42393
|
color: colors.gray[400]
|
|
42453
|
-
}, children: "..." }, `ellipsis-${index}`) : (0,
|
|
42394
|
+
}, children: "..." }, `ellipsis-${index}`) : (0, import_jsx_runtime36.jsx)(PageButton, { page, active: page === currentPage }, page)), (0, import_jsx_runtime36.jsx)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(currentPage + 1), disabled: disabled || currentPage === totalPages, "aria-label": "Next page", children: (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-right", size: iconSize }) }), showFirstLast && (0, import_jsx_runtime36.jsxs)(Button, { variant: "ghost", size: buttonSize, onClick: () => onPageChange?.(totalPages), disabled: disabled || currentPage === totalPages, "aria-label": "Last page", children: [(0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-right", size: iconSize }), (0, import_jsx_runtime36.jsx)(Icon, { name: "chevron-right", size: iconSize, style: { marginLeft: "-8px" } })] })] });
|
|
42454
42395
|
}
|
|
42455
42396
|
function EmptyState({ icon, title, description, action, style, className }) {
|
|
42456
42397
|
const composedStyle = {
|
|
@@ -42458,11 +42399,11 @@ function EmptyState({ icon, title, description, action, style, className }) {
|
|
|
42458
42399
|
padding: "var(--ggui-spacing-xl, 32px)",
|
|
42459
42400
|
...style
|
|
42460
42401
|
};
|
|
42461
|
-
return (0,
|
|
42402
|
+
return (0, import_jsx_runtime37.jsxs)(Stack, { align: "center", gap: "sm", className, style: composedStyle, children: [icon !== void 0 && (typeof icon === "string" ? (0, import_jsx_runtime37.jsx)(Icon, { name: icon, size: 40, tone: "subtle" }) : icon), (0, import_jsx_runtime37.jsx)(Heading, { level: 3, children: title }), description !== void 0 && (0, import_jsx_runtime37.jsx)(Text, { tone: "muted", children: description }), action !== void 0 && (0, import_jsx_runtime37.jsx)("div", { style: { marginTop: "var(--ggui-spacing-sm, 8px)" }, children: action })] });
|
|
42462
42403
|
}
|
|
42463
42404
|
function Stat({ label, value, delta, trend = "neutral", icon, style, className }) {
|
|
42464
42405
|
const deltaTone = trend === "up" ? "success" : trend === "down" ? "error" : "muted";
|
|
42465
|
-
return (0,
|
|
42406
|
+
return (0, import_jsx_runtime38.jsxs)(Stack, { gap: "xs", className, style, children: [(0, import_jsx_runtime38.jsxs)(Row, { gap: "xs", align: "center", children: [icon !== void 0 && (typeof icon === "string" ? (0, import_jsx_runtime38.jsx)(Icon, { name: icon, size: 16, tone: "muted" }) : icon), (0, import_jsx_runtime38.jsx)(Text, { size: "xs", weight: "semibold", caps: true, tone: "muted", children: label })] }), (0, import_jsx_runtime38.jsxs)(Row, { gap: "sm", align: "end", children: [(0, import_jsx_runtime38.jsx)(Text, { size: "3xl", weight: "bold", children: value }), delta !== void 0 && (0, import_jsx_runtime38.jsx)(Text, { size: "sm", weight: "semibold", tone: deltaTone, children: delta })] })] });
|
|
42466
42407
|
}
|
|
42467
42408
|
var MARKER_SIZE = 28;
|
|
42468
42409
|
function stepState(index, current) {
|
|
@@ -42490,7 +42431,7 @@ var markerStyles = {
|
|
|
42490
42431
|
}
|
|
42491
42432
|
};
|
|
42492
42433
|
function Marker({ index, state }) {
|
|
42493
|
-
return (0,
|
|
42434
|
+
return (0, import_jsx_runtime39.jsx)("span", { "aria-hidden": "true", style: {
|
|
42494
42435
|
width: MARKER_SIZE,
|
|
42495
42436
|
height: MARKER_SIZE,
|
|
42496
42437
|
borderRadius: "50%",
|
|
@@ -42501,19 +42442,19 @@ function Marker({ index, state }) {
|
|
|
42501
42442
|
boxSizing: "border-box",
|
|
42502
42443
|
transition: "background-color 0.2s, border-color 0.2s, color 0.2s",
|
|
42503
42444
|
...markerStyles[state]
|
|
42504
|
-
}, children: state === "completed" ? (0,
|
|
42445
|
+
}, children: state === "completed" ? (0, import_jsx_runtime39.jsx)(Icon, { name: "check", size: 16, tone: "inherit" }) : (0, import_jsx_runtime39.jsx)(Text, { is: "span", size: "sm", weight: "semibold", tone: "inherit", children: index + 1 }) });
|
|
42505
42446
|
}
|
|
42506
42447
|
function StepLabel({ label, state }) {
|
|
42507
|
-
return (0,
|
|
42448
|
+
return (0, import_jsx_runtime39.jsx)(Text, { is: "span", size: "sm", weight: state === "current" ? "semibold" : "normal", tone: state === "upcoming" ? "muted" : "default", children: label });
|
|
42508
42449
|
}
|
|
42509
42450
|
function Stepper({ steps, current, orientation = "horizontal", onStepClick, style, className }) {
|
|
42510
42451
|
const renderStep = (label, index) => {
|
|
42511
42452
|
const state = stepState(index, current);
|
|
42512
|
-
const content = (0,
|
|
42453
|
+
const content = (0, import_jsx_runtime39.jsxs)(Row, { gap: "sm", align: "center", children: [(0, import_jsx_runtime39.jsx)(Marker, { index, state }), (0, import_jsx_runtime39.jsx)(StepLabel, { label, state })] });
|
|
42513
42454
|
if (onStepClick === void 0) {
|
|
42514
|
-
return (0,
|
|
42455
|
+
return (0, import_jsx_runtime39.jsx)("span", { "aria-current": state === "current" ? "step" : void 0, children: content });
|
|
42515
42456
|
}
|
|
42516
|
-
return (0,
|
|
42457
|
+
return (0, import_jsx_runtime39.jsx)("button", { type: "button", onClick: () => onStepClick(index), "aria-current": state === "current" ? "step" : void 0, style: {
|
|
42517
42458
|
background: "none",
|
|
42518
42459
|
border: "none",
|
|
42519
42460
|
padding: 0,
|
|
@@ -42524,14 +42465,14 @@ function Stepper({ steps, current, orientation = "horizontal", onStepClick, styl
|
|
|
42524
42465
|
}, children: content });
|
|
42525
42466
|
};
|
|
42526
42467
|
if (orientation === "vertical") {
|
|
42527
|
-
return (0,
|
|
42468
|
+
return (0, import_jsx_runtime39.jsx)("nav", { "aria-label": "Progress", className, style, children: (0, import_jsx_runtime39.jsx)(Stack, { gap: "none", align: "start", children: steps.map((label, index) => (0, import_jsx_runtime39.jsxs)(Stack, { gap: "none", align: "start", children: [index > 0 && (0, import_jsx_runtime39.jsx)("span", { style: {
|
|
42528
42469
|
width: MARKER_SIZE,
|
|
42529
42470
|
height: 16,
|
|
42530
42471
|
display: "inline-flex",
|
|
42531
42472
|
justifyContent: "center"
|
|
42532
|
-
}, children: (0,
|
|
42473
|
+
}, children: (0, import_jsx_runtime39.jsx)(Divider, { orientation: "vertical", margin: 0 }) }), renderStep(label, index)] }, index)) }) });
|
|
42533
42474
|
}
|
|
42534
|
-
return (0,
|
|
42475
|
+
return (0, import_jsx_runtime39.jsx)("nav", { "aria-label": "Progress", className, style, children: (0, import_jsx_runtime39.jsx)(Row, { gap: "sm", align: "center", children: steps.map((label, index) => (0, import_jsx_runtime39.jsxs)(Row, { gap: "sm", align: "center", style: index > 0 ? { flex: 1 } : void 0, children: [index > 0 && (0, import_jsx_runtime39.jsx)(Divider, { style: { flex: 1, minWidth: 16, margin: 0 } }), renderStep(label, index)] }, index)) }) });
|
|
42535
42476
|
}
|
|
42536
42477
|
var SAFE_HREF = /^(?:https?:\/\/|mailto:)[^\s\x00-\x1f]+$/i;
|
|
42537
42478
|
function safeHref(raw) {
|
|
@@ -42840,16 +42781,16 @@ function renderRichTextInlines(inlines) {
|
|
|
42840
42781
|
case "text":
|
|
42841
42782
|
return node.text;
|
|
42842
42783
|
case "break":
|
|
42843
|
-
return (0,
|
|
42784
|
+
return (0, import_jsx_runtime40.jsx)("br", {}, i);
|
|
42844
42785
|
case "strong":
|
|
42845
|
-
return (0,
|
|
42786
|
+
return (0, import_jsx_runtime40.jsx)("strong", { children: renderRichTextInlines(node.children) }, i);
|
|
42846
42787
|
case "em":
|
|
42847
|
-
return (0,
|
|
42788
|
+
return (0, import_jsx_runtime40.jsx)("em", { children: renderRichTextInlines(node.children) }, i);
|
|
42848
42789
|
case "code":
|
|
42849
|
-
return (0,
|
|
42790
|
+
return (0, import_jsx_runtime40.jsx)("code", { style: CODE_INLINE, children: node.code }, i);
|
|
42850
42791
|
case "link": {
|
|
42851
42792
|
const children = renderRichTextInlines(node.children);
|
|
42852
|
-
return node.href !== void 0 ? (0,
|
|
42793
|
+
return node.href !== void 0 ? (0, import_jsx_runtime40.jsx)(Link, { href: node.href, external: true, children }, i) : (0, import_jsx_runtime40.jsx)("span", { style: LINK_INERT, children }, i);
|
|
42853
42794
|
}
|
|
42854
42795
|
}
|
|
42855
42796
|
});
|
|
@@ -42857,20 +42798,20 @@ function renderRichTextInlines(inlines) {
|
|
|
42857
42798
|
function renderBlock(block, key) {
|
|
42858
42799
|
switch (block.type) {
|
|
42859
42800
|
case "paragraph":
|
|
42860
|
-
return (0,
|
|
42801
|
+
return (0, import_jsx_runtime40.jsx)(Text, { children: renderRichTextInlines(block.children) }, key);
|
|
42861
42802
|
case "heading":
|
|
42862
|
-
return (0,
|
|
42803
|
+
return (0, import_jsx_runtime40.jsx)(Heading, { level: block.level, children: renderRichTextInlines(block.children) }, key);
|
|
42863
42804
|
case "code-fence":
|
|
42864
|
-
return (0,
|
|
42805
|
+
return (0, import_jsx_runtime40.jsx)("pre", { style: CODE_FENCE, "data-lang": block.lang, children: (0, import_jsx_runtime40.jsx)("code", { children: block.code }) }, key);
|
|
42865
42806
|
case "list": {
|
|
42866
|
-
const items = block.items.map((item, i) => (0,
|
|
42867
|
-
return block.ordered ? (0,
|
|
42807
|
+
const items = block.items.map((item, i) => (0, import_jsx_runtime40.jsx)("li", { children: renderRichTextInlines(item.children) }, i));
|
|
42808
|
+
return block.ordered ? (0, import_jsx_runtime40.jsx)("ol", { start: block.start, style: LIST, children: items }, key) : (0, import_jsx_runtime40.jsx)("ul", { style: LIST, children: items }, key);
|
|
42868
42809
|
}
|
|
42869
42810
|
}
|
|
42870
42811
|
}
|
|
42871
42812
|
function Markdown({ markdown, className, style }) {
|
|
42872
42813
|
const blocks = parseRichText(markdown);
|
|
42873
|
-
return (0,
|
|
42814
|
+
return (0, import_jsx_runtime40.jsx)("div", { className, "data-ggui-markdown": "", style: {
|
|
42874
42815
|
display: "flex",
|
|
42875
42816
|
flexDirection: "column",
|
|
42876
42817
|
gap: "var(--ggui-spacing-sm, 12px)",
|
|
@@ -42878,7 +42819,7 @@ function Markdown({ markdown, className, style }) {
|
|
|
42878
42819
|
}, children: blocks.map(renderBlock) });
|
|
42879
42820
|
}
|
|
42880
42821
|
function MarkdownInline({ markdown }) {
|
|
42881
|
-
return (0,
|
|
42822
|
+
return (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children: renderRichTextInlines(parseInlineRichText(markdown)) });
|
|
42882
42823
|
}
|
|
42883
42824
|
var compositions_exports = {};
|
|
42884
42825
|
__export2(compositions_exports, {
|
|
@@ -42897,7 +42838,7 @@ __export2(compositions_exports, {
|
|
|
42897
42838
|
Sidebar: () => Sidebar
|
|
42898
42839
|
});
|
|
42899
42840
|
function Header({ logo, navigation: navigation2, actions, sticky = false, background, bordered = true, style, className }) {
|
|
42900
|
-
return (0,
|
|
42841
|
+
return (0, import_jsx_runtime41.jsxs)("header", { className, style: {
|
|
42901
42842
|
display: "flex",
|
|
42902
42843
|
alignItems: "center",
|
|
42903
42844
|
justifyContent: "space-between",
|
|
@@ -42911,10 +42852,10 @@ function Header({ logo, navigation: navigation2, actions, sticky = false, backgr
|
|
|
42911
42852
|
boxShadow: shadow.sm
|
|
42912
42853
|
},
|
|
42913
42854
|
...style
|
|
42914
|
-
}, children: [logo && (0,
|
|
42855
|
+
}, children: [logo && (0, import_jsx_runtime41.jsx)("div", { style: { flexShrink: 0 }, children: logo }), navigation2 && (0, import_jsx_runtime41.jsx)("nav", { style: { display: "flex", alignItems: "center", flex: 1, marginLeft: "32px" }, children: navigation2 }), actions && (0, import_jsx_runtime41.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "12px", flexShrink: 0 }, children: actions })] });
|
|
42915
42856
|
}
|
|
42916
42857
|
function SidebarItem({ item, activeId, onItemClick, collapsed, depth = 0 }) {
|
|
42917
|
-
const [expanded, setExpanded] = (0,
|
|
42858
|
+
const [expanded, setExpanded] = (0, import_react31.useState)(false);
|
|
42918
42859
|
const hasChildren = item.children && item.children.length > 0;
|
|
42919
42860
|
const isActive = activeId === item.id;
|
|
42920
42861
|
const handleClick = () => {
|
|
@@ -42923,7 +42864,7 @@ function SidebarItem({ item, activeId, onItemClick, collapsed, depth = 0 }) {
|
|
|
42923
42864
|
}
|
|
42924
42865
|
onItemClick?.(item);
|
|
42925
42866
|
};
|
|
42926
|
-
return (0,
|
|
42867
|
+
return (0, import_jsx_runtime42.jsxs)("div", { children: [(0, import_jsx_runtime42.jsxs)("button", { onClick: handleClick, disabled: item.disabled, style: {
|
|
42927
42868
|
display: "flex",
|
|
42928
42869
|
alignItems: "center",
|
|
42929
42870
|
gap: "12px",
|
|
@@ -42940,11 +42881,11 @@ function SidebarItem({ item, activeId, onItemClick, collapsed, depth = 0 }) {
|
|
|
42940
42881
|
cursor: item.disabled ? "not-allowed" : "pointer",
|
|
42941
42882
|
transition: "all 0.15s",
|
|
42942
42883
|
justifyContent: collapsed ? "center" : "flex-start"
|
|
42943
|
-
}, children: [item.icon && (0,
|
|
42884
|
+
}, children: [item.icon && (0, import_jsx_runtime42.jsx)("span", { style: { display: "flex", flexShrink: 0 }, children: item.icon }), !collapsed && (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [(0, import_jsx_runtime42.jsx)("span", { style: { flex: 1 }, children: item.label }), item.badge && (0, import_jsx_runtime42.jsx)("span", { children: item.badge }), hasChildren && (0, import_jsx_runtime42.jsx)(Icon, { name: expanded ? "chevron-down" : "chevron-right", size: 14, tone: "subtle" })] })] }), hasChildren && expanded && !collapsed && (0, import_jsx_runtime42.jsx)("div", { style: { marginTop: "4px" }, children: item.children.map((child) => (0, import_jsx_runtime42.jsx)(SidebarItem, { item: child, activeId, onItemClick, collapsed, depth: depth + 1 }, child.id)) })] });
|
|
42944
42885
|
}
|
|
42945
42886
|
function Sidebar({ items, activeId, onItemClick, collapsed = false, header, footer, width = 256, collapsedWidth = 64, style, className }) {
|
|
42946
42887
|
const currentWidth = collapsed ? collapsedWidth : width;
|
|
42947
|
-
return (0,
|
|
42888
|
+
return (0, import_jsx_runtime42.jsxs)("aside", { className, style: {
|
|
42948
42889
|
width: currentWidth,
|
|
42949
42890
|
minWidth: currentWidth,
|
|
42950
42891
|
height: "100%",
|
|
@@ -42955,15 +42896,15 @@ function Sidebar({ items, activeId, onItemClick, collapsed = false, header, foot
|
|
|
42955
42896
|
transition: "width 0.2s",
|
|
42956
42897
|
overflow: "hidden",
|
|
42957
42898
|
...style
|
|
42958
|
-
}, children: [header && (0,
|
|
42899
|
+
}, children: [header && (0, import_jsx_runtime42.jsx)("div", { style: {
|
|
42959
42900
|
padding: collapsed ? "16px 8px" : "16px",
|
|
42960
42901
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
42961
|
-
}, children: header }), (0,
|
|
42902
|
+
}, children: header }), (0, import_jsx_runtime42.jsx)("nav", { style: {
|
|
42962
42903
|
flex: 1,
|
|
42963
42904
|
padding: "8px",
|
|
42964
42905
|
overflowY: "auto",
|
|
42965
42906
|
overflowX: "hidden"
|
|
42966
|
-
}, children: (0,
|
|
42907
|
+
}, children: (0, import_jsx_runtime42.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "2px" }, children: items.map((item) => (0, import_jsx_runtime42.jsx)(SidebarItem, { item, activeId, onItemClick, collapsed }, item.id)) }) }), footer && (0, import_jsx_runtime42.jsx)("div", { style: {
|
|
42967
42908
|
padding: collapsed ? "16px 8px" : "16px",
|
|
42968
42909
|
borderTop: `1px solid ${colors.gray[200]}`
|
|
42969
42910
|
}, children: footer })] });
|
|
@@ -42975,7 +42916,7 @@ function CardGrid({ children, columns = 3, gap = 16, style, className }) {
|
|
|
42975
42916
|
}
|
|
42976
42917
|
return `repeat(auto-fit, minmax(280px, 1fr))`;
|
|
42977
42918
|
};
|
|
42978
|
-
return (0,
|
|
42919
|
+
return (0, import_jsx_runtime43.jsx)("div", { className, style: {
|
|
42979
42920
|
display: "grid",
|
|
42980
42921
|
gridTemplateColumns: getGridColumns(),
|
|
42981
42922
|
gap: `${gap}px`,
|
|
@@ -42983,8 +42924,8 @@ function CardGrid({ children, columns = 3, gap = 16, style, className }) {
|
|
|
42983
42924
|
}, children });
|
|
42984
42925
|
}
|
|
42985
42926
|
function CommentItem({ comment, onReply, onReaction, depth = 0 }) {
|
|
42986
|
-
const [showReplyInput, setShowReplyInput] = (0,
|
|
42987
|
-
const [replyContent, setReplyContent] = (0,
|
|
42927
|
+
const [showReplyInput, setShowReplyInput] = (0, import_react32.useState)(false);
|
|
42928
|
+
const [replyContent, setReplyContent] = (0, import_react32.useState)("");
|
|
42988
42929
|
const handleSubmitReply = () => {
|
|
42989
42930
|
if (replyContent.trim()) {
|
|
42990
42931
|
onReply?.(comment.id, replyContent);
|
|
@@ -42993,30 +42934,30 @@ function CommentItem({ comment, onReply, onReaction, depth = 0 }) {
|
|
|
42993
42934
|
}
|
|
42994
42935
|
};
|
|
42995
42936
|
const timestamp = comment.timestamp instanceof Date ? comment.timestamp.toLocaleString() : comment.timestamp;
|
|
42996
|
-
return (0,
|
|
42937
|
+
return (0, import_jsx_runtime44.jsxs)("div", { style: { marginLeft: depth > 0 ? "40px" : 0 }, children: [(0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: "12px" }, children: [(0, import_jsx_runtime44.jsx)(Avatar, { name: comment.author.name, src: comment.author.avatar, size: "sm" }), (0, import_jsx_runtime44.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [(0, import_jsx_runtime44.jsx)("span", { style: { fontWeight: 500, fontSize: fontSize.sm }, children: comment.author.name }), (0, import_jsx_runtime44.jsx)("span", { style: { color: colors.gray[500], fontSize: fontSize.xs }, children: timestamp })] }), (0, import_jsx_runtime44.jsx)("p", { style: { margin: "4px 0 8px", fontSize: fontSize.sm, color: colors.gray[700] }, children: comment.content }), (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px" }, children: [comment.reactions?.map((reaction) => (0, import_jsx_runtime44.jsxs)("button", { onClick: () => onReaction?.(comment.id, reaction.emoji), style: {
|
|
42997
42938
|
padding: "2px 8px",
|
|
42998
42939
|
border: `1px solid ${colors.gray[200]}`,
|
|
42999
42940
|
borderRadius: "12px",
|
|
43000
42941
|
backgroundColor: colors.gray[50],
|
|
43001
42942
|
fontSize: fontSize.xs,
|
|
43002
42943
|
cursor: "pointer"
|
|
43003
|
-
}, children: [reaction.emoji, " ", reaction.count] }, reaction.emoji)), (0,
|
|
42944
|
+
}, children: [reaction.emoji, " ", reaction.count] }, reaction.emoji)), (0, import_jsx_runtime44.jsx)("button", { onClick: () => setShowReplyInput(!showReplyInput), style: {
|
|
43004
42945
|
background: "none",
|
|
43005
42946
|
border: "none",
|
|
43006
42947
|
color: colors.gray[500],
|
|
43007
42948
|
fontSize: fontSize.xs,
|
|
43008
42949
|
cursor: "pointer"
|
|
43009
|
-
}, children: "Reply" })] }), showReplyInput && (0,
|
|
42950
|
+
}, children: "Reply" })] }), showReplyInput && (0, import_jsx_runtime44.jsxs)("div", { style: { marginTop: "12px" }, children: [(0, import_jsx_runtime44.jsx)(TextArea, { value: replyContent, onChange: setReplyContent, placeholder: "Write a reply...", rows: 2 }), (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: "8px", marginTop: "8px" }, children: [(0, import_jsx_runtime44.jsx)(Button, { size: "sm", onClick: handleSubmitReply, children: "Reply" }), (0, import_jsx_runtime44.jsx)(Button, { size: "sm", variant: "ghost", onClick: () => setShowReplyInput(false), children: "Cancel" })] })] })] })] }), comment.replies?.map((reply) => (0, import_jsx_runtime44.jsx)("div", { style: { marginTop: "16px" }, children: (0, import_jsx_runtime44.jsx)(CommentItem, { comment: reply, onReply, onReaction, depth: depth + 1 }) }, reply.id))] });
|
|
43010
42951
|
}
|
|
43011
42952
|
function CommentThread({ comments, currentUser, onAddComment, onReply, onReaction, loading, style, className }) {
|
|
43012
|
-
const [newComment, setNewComment] = (0,
|
|
42953
|
+
const [newComment, setNewComment] = (0, import_react32.useState)("");
|
|
43013
42954
|
const handleSubmit = () => {
|
|
43014
42955
|
if (newComment.trim()) {
|
|
43015
42956
|
onAddComment?.(newComment);
|
|
43016
42957
|
setNewComment("");
|
|
43017
42958
|
}
|
|
43018
42959
|
};
|
|
43019
|
-
return (0,
|
|
42960
|
+
return (0, import_jsx_runtime44.jsxs)("div", { className, style: { ...style }, children: [currentUser && (0, import_jsx_runtime44.jsxs)("div", { style: { display: "flex", gap: "12px", marginBottom: "24px" }, children: [(0, import_jsx_runtime44.jsx)(Avatar, { name: currentUser.name, src: currentUser.avatar, size: "sm" }), (0, import_jsx_runtime44.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime44.jsx)(TextArea, { value: newComment, onChange: setNewComment, placeholder: "Write a comment...", rows: 3 }), (0, import_jsx_runtime44.jsx)("div", { style: { marginTop: "8px", display: "flex", justifyContent: "flex-end" }, children: (0, import_jsx_runtime44.jsx)(Button, { onClick: handleSubmit, disabled: !newComment.trim(), children: "Comment" }) })] })] }), loading ? (0, import_jsx_runtime44.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "24px" }, children: (0, import_jsx_runtime44.jsx)(Spinner, { size: 24 }) }) : (0, import_jsx_runtime44.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "20px" }, children: comments.map((comment) => (0, import_jsx_runtime44.jsx)(CommentItem, { comment, onReply, onReaction }, comment.id)) })] });
|
|
43020
42961
|
}
|
|
43021
42962
|
function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data", onSort, sortKey, sortDirection, onRowClick, selectable, selectedKeys = [], onSelectionChange, style, className }) {
|
|
43022
42963
|
const getRowKey = (row, index) => {
|
|
@@ -43041,16 +42982,16 @@ function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data
|
|
|
43041
42982
|
};
|
|
43042
42983
|
const allSelected = data.length > 0 && selectedKeys.length === data.length;
|
|
43043
42984
|
const someSelected = selectedKeys.length > 0 && selectedKeys.length < data.length;
|
|
43044
|
-
return (0,
|
|
42985
|
+
return (0, import_jsx_runtime45.jsx)("div", { className, style: {
|
|
43045
42986
|
border: `1px solid ${colors.gray[200]}`,
|
|
43046
42987
|
borderRadius: "8px",
|
|
43047
42988
|
overflow: "hidden",
|
|
43048
42989
|
...style
|
|
43049
|
-
}, children: (0,
|
|
42990
|
+
}, children: (0, import_jsx_runtime45.jsxs)("table", { style: {
|
|
43050
42991
|
width: "100%",
|
|
43051
42992
|
borderCollapse: "collapse",
|
|
43052
42993
|
fontSize: fontSize.sm
|
|
43053
|
-
}, children: [(0,
|
|
42994
|
+
}, children: [(0, import_jsx_runtime45.jsx)("thead", { children: (0, import_jsx_runtime45.jsxs)("tr", { style: { backgroundColor: colors.gray[50] }, children: [selectable && (0, import_jsx_runtime45.jsx)("th", { style: { width: "40px", padding: "12px" }, children: (0, import_jsx_runtime45.jsx)(Checkbox, { checked: allSelected, indeterminate: someSelected, onChange: handleSelectAll }) }), columns.map((col) => (0, import_jsx_runtime45.jsx)("th", { style: {
|
|
43054
42995
|
padding: "12px 16px",
|
|
43055
42996
|
textAlign: col.align || "left",
|
|
43056
42997
|
fontWeight: fontWeight.semibold,
|
|
@@ -43058,14 +42999,14 @@ function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data
|
|
|
43058
42999
|
borderBottom: `1px solid ${colors.gray[200]}`,
|
|
43059
43000
|
cursor: col.sortable ? "pointer" : void 0,
|
|
43060
43001
|
width: col.width
|
|
43061
|
-
}, onClick: () => col.sortable && onSort?.(col.key, sortKey === col.key && sortDirection === "asc" ? "desc" : "asc"), children: (0,
|
|
43002
|
+
}, onClick: () => col.sortable && onSort?.(col.key, sortKey === col.key && sortDirection === "asc" ? "desc" : "asc"), children: (0, import_jsx_runtime45.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "4px" }, children: [col.header, col.sortable && sortKey === col.key && (0, import_jsx_runtime45.jsx)(Icon, { name: sortDirection === "asc" ? "chevron-up" : "chevron-down", size: 14 })] }) }, col.key))] }) }), (0, import_jsx_runtime45.jsx)("tbody", { children: loading ? (0, import_jsx_runtime45.jsx)("tr", { children: (0, import_jsx_runtime45.jsx)("td", { colSpan: columns.length + (selectable ? 1 : 0), style: { padding: "48px", textAlign: "center" }, children: (0, import_jsx_runtime45.jsx)(Spinner, { size: 24 }) }) }) : data.length === 0 ? (0, import_jsx_runtime45.jsx)("tr", { children: (0, import_jsx_runtime45.jsx)("td", { colSpan: columns.length + (selectable ? 1 : 0), style: { padding: "48px", textAlign: "center", color: colors.gray[500] }, children: emptyText }) }) : data.map((row, index) => {
|
|
43062
43003
|
const key = getRowKey(row, index);
|
|
43063
43004
|
const isSelected = selectedKeys.includes(key);
|
|
43064
|
-
return (0,
|
|
43005
|
+
return (0, import_jsx_runtime45.jsxs)("tr", { onClick: () => onRowClick?.(row, index), style: {
|
|
43065
43006
|
backgroundColor: isSelected ? colors.primary[50] : void 0,
|
|
43066
43007
|
cursor: onRowClick ? "pointer" : void 0,
|
|
43067
43008
|
transition: "background-color 0.15s"
|
|
43068
|
-
}, children: [selectable && (0,
|
|
43009
|
+
}, children: [selectable && (0, import_jsx_runtime45.jsx)("td", { style: { padding: "12px" }, children: (0, import_jsx_runtime45.jsx)(Checkbox, { checked: isSelected, onChange: (checked) => handleSelectRow(key, checked) }) }), columns.map((col) => (0, import_jsx_runtime45.jsx)("td", { style: {
|
|
43069
43010
|
padding: "12px 16px",
|
|
43070
43011
|
textAlign: col.align || "left",
|
|
43071
43012
|
color: colors.gray[900],
|
|
@@ -43074,9 +43015,9 @@ function DataTable({ columns, data, rowKey = "id", loading, emptyText = "No data
|
|
|
43074
43015
|
}) })] }) });
|
|
43075
43016
|
}
|
|
43076
43017
|
function ChatWindow({ messages, currentUserId, onSendMessage, loading, typing, placeholder = "Type a message...", header, style, className }) {
|
|
43077
|
-
const [inputValue, setInputValue] = (0,
|
|
43078
|
-
const messagesEndRef = (0,
|
|
43079
|
-
(0,
|
|
43018
|
+
const [inputValue, setInputValue] = (0, import_react33.useState)("");
|
|
43019
|
+
const messagesEndRef = (0, import_react33.useRef)(null);
|
|
43020
|
+
(0, import_react33.useEffect)(() => {
|
|
43080
43021
|
messagesEndRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
43081
43022
|
}, [messages]);
|
|
43082
43023
|
const handleSend = () => {
|
|
@@ -43091,7 +43032,7 @@ function ChatWindow({ messages, currentUserId, onSendMessage, loading, typing, p
|
|
|
43091
43032
|
handleSend();
|
|
43092
43033
|
}
|
|
43093
43034
|
};
|
|
43094
|
-
return (0,
|
|
43035
|
+
return (0, import_jsx_runtime46.jsxs)("div", { className, style: {
|
|
43095
43036
|
display: "flex",
|
|
43096
43037
|
flexDirection: "column",
|
|
43097
43038
|
height: "100%",
|
|
@@ -43100,51 +43041,51 @@ function ChatWindow({ messages, currentUserId, onSendMessage, loading, typing, p
|
|
|
43100
43041
|
backgroundColor: colors.white,
|
|
43101
43042
|
overflow: "hidden",
|
|
43102
43043
|
...style
|
|
43103
|
-
}, children: [header && (0,
|
|
43044
|
+
}, children: [header && (0, import_jsx_runtime46.jsx)("div", { style: {
|
|
43104
43045
|
padding: "12px 16px",
|
|
43105
43046
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
43106
|
-
}, children: header }), (0,
|
|
43047
|
+
}, children: header }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43107
43048
|
flex: 1,
|
|
43108
43049
|
padding: "16px",
|
|
43109
43050
|
overflowY: "auto",
|
|
43110
43051
|
display: "flex",
|
|
43111
43052
|
flexDirection: "column",
|
|
43112
43053
|
gap: "12px"
|
|
43113
|
-
}, children: [loading ? (0,
|
|
43054
|
+
}, children: [loading ? (0, import_jsx_runtime46.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "24px" }, children: (0, import_jsx_runtime46.jsx)(Spinner, { size: 24 }) }) : messages.map((message) => {
|
|
43114
43055
|
const isOwn = message.sender.id === currentUserId;
|
|
43115
43056
|
const timestamp = message.timestamp instanceof Date ? message.timestamp.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }) : message.timestamp;
|
|
43116
|
-
return (0,
|
|
43057
|
+
return (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43117
43058
|
display: "flex",
|
|
43118
43059
|
flexDirection: isOwn ? "row-reverse" : "row",
|
|
43119
43060
|
alignItems: "flex-end",
|
|
43120
43061
|
gap: "8px"
|
|
43121
|
-
}, children: [!isOwn && (0,
|
|
43062
|
+
}, children: [!isOwn && (0, import_jsx_runtime46.jsx)(Avatar, { name: message.sender.name, src: message.sender.avatar, size: "xs" }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43122
43063
|
maxWidth: "70%",
|
|
43123
43064
|
padding: "10px 14px",
|
|
43124
43065
|
borderRadius: radius.lg,
|
|
43125
43066
|
backgroundColor: isOwn ? colors.primary[600] : colors.gray[100],
|
|
43126
43067
|
color: isOwn ? colors.white : colors.gray[900]
|
|
43127
|
-
}, children: [(0,
|
|
43068
|
+
}, children: [(0, import_jsx_runtime46.jsx)("p", { style: { margin: 0, fontSize: fontSize.sm }, children: message.content }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43128
43069
|
display: "flex",
|
|
43129
43070
|
alignItems: "center",
|
|
43130
43071
|
gap: "4px",
|
|
43131
43072
|
marginTop: "4px",
|
|
43132
43073
|
fontSize: fontSize.xs,
|
|
43133
43074
|
opacity: 0.7
|
|
43134
|
-
}, children: [(0,
|
|
43135
|
-
}), typing && (0,
|
|
43075
|
+
}, children: [(0, import_jsx_runtime46.jsx)("span", { children: timestamp }), isOwn && message.status && (0, import_jsx_runtime46.jsxs)("span", { children: [message.status === "sending" && "\u2022", message.status === "sent" && "\u2713", message.status === "delivered" && "\u2713\u2713", message.status === "read" && "\u2713\u2713", message.status === "error" && "!"] })] })] })] }, message.id);
|
|
43076
|
+
}), typing && (0, import_jsx_runtime46.jsx)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: (0, import_jsx_runtime46.jsxs)("span", { style: { fontSize: fontSize.xs, color: colors.gray[500] }, children: [typing.name, " is typing..."] }) }), (0, import_jsx_runtime46.jsx)("div", { ref: messagesEndRef })] }), (0, import_jsx_runtime46.jsxs)("div", { style: {
|
|
43136
43077
|
padding: "12px 16px",
|
|
43137
43078
|
borderTop: `1px solid ${colors.gray[200]}`,
|
|
43138
43079
|
display: "flex",
|
|
43139
43080
|
gap: "8px"
|
|
43140
|
-
}, children: [(0,
|
|
43081
|
+
}, children: [(0, import_jsx_runtime46.jsx)("input", { type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), onKeyDown: handleKeyDown, placeholder, style: {
|
|
43141
43082
|
flex: 1,
|
|
43142
43083
|
padding: "10px 14px",
|
|
43143
43084
|
border: `1px solid ${colors.gray[300]}`,
|
|
43144
43085
|
borderRadius: radius.full,
|
|
43145
43086
|
fontSize: fontSize.sm,
|
|
43146
43087
|
outline: "none"
|
|
43147
|
-
} }), (0,
|
|
43088
|
+
} }), (0, import_jsx_runtime46.jsx)(Button, { onClick: handleSend, disabled: !inputValue.trim(), children: (0, import_jsx_runtime46.jsx)(Icon, { name: "chevron-right", size: 18 }) })] })] });
|
|
43148
43089
|
}
|
|
43149
43090
|
function NavigationBar({ items, activeId, onItemClick, orientation = "horizontal", variant = "default", style, className }) {
|
|
43150
43091
|
const renderItem = (item) => {
|
|
@@ -43186,16 +43127,16 @@ function NavigationBar({ items, activeId, onItemClick, orientation = "horizontal
|
|
|
43186
43127
|
onItemClick?.(item);
|
|
43187
43128
|
}
|
|
43188
43129
|
};
|
|
43189
|
-
const content = (0,
|
|
43130
|
+
const content = (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [item.icon && (0, import_jsx_runtime47.jsx)("span", { style: { display: "flex" }, children: item.icon }), (0, import_jsx_runtime47.jsx)("span", { children: item.label })] });
|
|
43190
43131
|
if (item.href) {
|
|
43191
|
-
return (0,
|
|
43132
|
+
return (0, import_jsx_runtime47.jsx)("a", { href: item.href, onClick: (e) => {
|
|
43192
43133
|
e.preventDefault();
|
|
43193
43134
|
handleClick();
|
|
43194
43135
|
}, style: { ...baseStyle, ...variantStyles6[variant] }, children: content }, item.id);
|
|
43195
43136
|
}
|
|
43196
|
-
return (0,
|
|
43137
|
+
return (0, import_jsx_runtime47.jsx)("button", { onClick: handleClick, disabled: item.disabled, style: { ...baseStyle, ...variantStyles6[variant] }, children: content }, item.id);
|
|
43197
43138
|
};
|
|
43198
|
-
return (0,
|
|
43139
|
+
return (0, import_jsx_runtime47.jsx)("nav", { className, style: {
|
|
43199
43140
|
display: "flex",
|
|
43200
43141
|
flexDirection: orientation === "horizontal" ? "row" : "column",
|
|
43201
43142
|
gap: orientation === "horizontal" ? "4px" : "2px",
|
|
@@ -43214,8 +43155,8 @@ function formatFileSize(bytes) {
|
|
|
43214
43155
|
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${sizes[i]}`;
|
|
43215
43156
|
}
|
|
43216
43157
|
function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multiple = true, maxSize, maxFiles, disabled, dragDrop = true, style, className }) {
|
|
43217
|
-
const [isDragOver, setIsDragOver] = (0,
|
|
43218
|
-
const inputRef = (0,
|
|
43158
|
+
const [isDragOver, setIsDragOver] = (0, import_react34.useState)(false);
|
|
43159
|
+
const inputRef = (0, import_react34.useRef)(null);
|
|
43219
43160
|
const handleFiles = (fileList) => {
|
|
43220
43161
|
if (!fileList)
|
|
43221
43162
|
return;
|
|
@@ -43244,7 +43185,7 @@ function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multi
|
|
|
43244
43185
|
const handleDragLeave = () => {
|
|
43245
43186
|
setIsDragOver(false);
|
|
43246
43187
|
};
|
|
43247
|
-
return (0,
|
|
43188
|
+
return (0, import_jsx_runtime48.jsxs)("div", { className, style: { ...style }, children: [(0, import_jsx_runtime48.jsxs)("div", { onClick: () => !disabled && inputRef.current?.click(), onDrop: handleDrop, onDragOver: handleDragOver, onDragLeave: handleDragLeave, style: {
|
|
43248
43189
|
border: `2px dashed ${isDragOver ? colors.primary[400] : colors.gray[300]}`,
|
|
43249
43190
|
borderRadius: radius.lg,
|
|
43250
43191
|
padding: "32px",
|
|
@@ -43253,7 +43194,7 @@ function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multi
|
|
|
43253
43194
|
cursor: disabled ? "not-allowed" : "pointer",
|
|
43254
43195
|
transition: "all 0.2s",
|
|
43255
43196
|
opacity: disabled ? 0.5 : 1
|
|
43256
|
-
}, children: [(0,
|
|
43197
|
+
}, children: [(0, import_jsx_runtime48.jsx)("input", { ref: inputRef, type: "file", accept, multiple, onChange: (e) => handleFiles(e.target.files), disabled, style: { display: "none" } }), (0, import_jsx_runtime48.jsx)(Icon, { name: "plus", size: 32, tone: "subtle" }), (0, import_jsx_runtime48.jsx)("p", { style: { margin: "12px 0 4px", color: colors.gray[700], fontSize: fontSize.sm }, children: dragDrop ? "Drag and drop files here, or click to browse" : "Click to browse files" }), (0, import_jsx_runtime48.jsxs)("p", { style: { margin: 0, color: colors.gray[500], fontSize: fontSize.xs }, children: [accept && `Accepted: ${accept}`, maxSize && ` \u2022 Max size: ${formatFileSize(maxSize)}`, maxFiles && ` \u2022 Max files: ${maxFiles}`] })] }), files.length > 0 && (0, import_jsx_runtime48.jsx)("div", { style: { marginTop: "16px", display: "flex", flexDirection: "column", gap: "8px" }, children: files.map((file2) => (0, import_jsx_runtime48.jsxs)("div", { style: {
|
|
43257
43198
|
display: "flex",
|
|
43258
43199
|
alignItems: "center",
|
|
43259
43200
|
gap: "12px",
|
|
@@ -43261,14 +43202,14 @@ function FileUploader({ files = [], onFilesSelected, onFileRemove, accept, multi
|
|
|
43261
43202
|
border: `1px solid ${colors.gray[200]}`,
|
|
43262
43203
|
borderRadius: radius.md,
|
|
43263
43204
|
backgroundColor: colors.white
|
|
43264
|
-
}, children: [(0,
|
|
43205
|
+
}, children: [(0, import_jsx_runtime48.jsx)(Icon, { name: "menu", size: 20, tone: "subtle" }), (0, import_jsx_runtime48.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [(0, import_jsx_runtime48.jsx)("p", { style: {
|
|
43265
43206
|
margin: 0,
|
|
43266
43207
|
fontSize: fontSize.sm,
|
|
43267
43208
|
color: colors.gray[900],
|
|
43268
43209
|
whiteSpace: "nowrap",
|
|
43269
43210
|
overflow: "hidden",
|
|
43270
43211
|
textOverflow: "ellipsis"
|
|
43271
|
-
}, children: file2.name }), (0,
|
|
43212
|
+
}, children: file2.name }), (0, import_jsx_runtime48.jsxs)("p", { style: { margin: "2px 0 0", fontSize: fontSize.xs, color: colors.gray[500] }, children: [formatFileSize(file2.size), file2.error && (0, import_jsx_runtime48.jsx)("span", { style: { color: colors.error[500], marginLeft: "8px" }, children: file2.error })] }), file2.status === "uploading" && file2.progress !== void 0 && (0, import_jsx_runtime48.jsx)(Progress, { value: file2.progress, size: "sm", style: { marginTop: "8px" } })] }), (0, import_jsx_runtime48.jsx)(Button, { variant: "ghost", size: "sm", onClick: () => onFileRemove?.(file2.id), children: (0, import_jsx_runtime48.jsx)(Icon, { name: "x", size: 16 }) })] }, file2.id)) })] });
|
|
43272
43213
|
}
|
|
43273
43214
|
var variantColors2 = {
|
|
43274
43215
|
info: colors.info[500],
|
|
@@ -43279,44 +43220,44 @@ var variantColors2 = {
|
|
|
43279
43220
|
function NotificationItem({ notification, onMarkAsRead, onDismiss }) {
|
|
43280
43221
|
const timestamp = notification.timestamp instanceof Date ? notification.timestamp.toLocaleString() : notification.timestamp;
|
|
43281
43222
|
const typeColor = variantColors2[notification.type || "info"];
|
|
43282
|
-
return (0,
|
|
43223
|
+
return (0, import_jsx_runtime49.jsxs)("div", { style: {
|
|
43283
43224
|
display: "flex",
|
|
43284
43225
|
gap: "12px",
|
|
43285
43226
|
padding: "12px",
|
|
43286
43227
|
backgroundColor: notification.read ? "transparent" : colors.primary[50],
|
|
43287
43228
|
borderRadius: radius.md,
|
|
43288
43229
|
transition: "background-color 0.15s"
|
|
43289
|
-
}, children: [(0,
|
|
43230
|
+
}, children: [(0, import_jsx_runtime49.jsx)("div", { style: {
|
|
43290
43231
|
width: "8px",
|
|
43291
43232
|
height: "8px",
|
|
43292
43233
|
borderRadius: "50%",
|
|
43293
43234
|
backgroundColor: notification.read ? "transparent" : typeColor,
|
|
43294
43235
|
flexShrink: 0,
|
|
43295
43236
|
marginTop: "6px"
|
|
43296
|
-
} }), (0,
|
|
43237
|
+
} }), (0, import_jsx_runtime49.jsxs)("div", { style: { flex: 1, minWidth: 0 }, children: [(0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", gap: "8px" }, children: [(0, import_jsx_runtime49.jsx)("p", { style: {
|
|
43297
43238
|
margin: 0,
|
|
43298
43239
|
fontWeight: fontWeight.medium,
|
|
43299
43240
|
color: colors.gray[900],
|
|
43300
43241
|
fontSize: fontSize.sm
|
|
43301
|
-
}, children: notification.title }), (0,
|
|
43242
|
+
}, children: notification.title }), (0, import_jsx_runtime49.jsx)("button", { onClick: () => onDismiss?.(notification.id), style: {
|
|
43302
43243
|
background: "none",
|
|
43303
43244
|
border: "none",
|
|
43304
43245
|
padding: "2px",
|
|
43305
43246
|
cursor: "pointer",
|
|
43306
43247
|
color: colors.gray[400],
|
|
43307
43248
|
flexShrink: 0
|
|
43308
|
-
}, children: (0,
|
|
43249
|
+
}, children: (0, import_jsx_runtime49.jsx)(Icon, { name: "x", size: 14 }) })] }), notification.message && (0, import_jsx_runtime49.jsx)("p", { style: {
|
|
43309
43250
|
margin: "4px 0 0",
|
|
43310
43251
|
color: colors.gray[600],
|
|
43311
43252
|
fontSize: fontSize.xs
|
|
43312
|
-
}, children: notification.message }), (0,
|
|
43253
|
+
}, children: notification.message }), (0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "12px", marginTop: "8px" }, children: [(0, import_jsx_runtime49.jsx)("span", { style: { color: colors.gray[400], fontSize: fontSize.xs }, children: timestamp }), !notification.read && (0, import_jsx_runtime49.jsx)("button", { onClick: () => onMarkAsRead?.(notification.id), style: {
|
|
43313
43254
|
background: "none",
|
|
43314
43255
|
border: "none",
|
|
43315
43256
|
padding: 0,
|
|
43316
43257
|
color: colors.primary[600],
|
|
43317
43258
|
fontSize: fontSize.xs,
|
|
43318
43259
|
cursor: "pointer"
|
|
43319
|
-
}, children: "Mark as read" }), notification.action && (0,
|
|
43260
|
+
}, children: "Mark as read" }), notification.action && (0, import_jsx_runtime49.jsx)("button", { onClick: notification.action.onClick, style: {
|
|
43320
43261
|
background: "none",
|
|
43321
43262
|
border: "none",
|
|
43322
43263
|
padding: 0,
|
|
@@ -43327,24 +43268,24 @@ function NotificationItem({ notification, onMarkAsRead, onDismiss }) {
|
|
|
43327
43268
|
}
|
|
43328
43269
|
function NotificationCenter({ notifications, onMarkAsRead, onMarkAllAsRead, onDismiss, onClearAll, emptyText = "No notifications", loading, style, className }) {
|
|
43329
43270
|
const unreadCount = notifications.filter((n) => !n.read).length;
|
|
43330
|
-
return (0,
|
|
43271
|
+
return (0, import_jsx_runtime49.jsxs)("div", { className, style: {
|
|
43331
43272
|
display: "flex",
|
|
43332
43273
|
flexDirection: "column",
|
|
43333
43274
|
...style
|
|
43334
|
-
}, children: [(0,
|
|
43275
|
+
}, children: [(0, import_jsx_runtime49.jsxs)("div", { style: {
|
|
43335
43276
|
display: "flex",
|
|
43336
43277
|
alignItems: "center",
|
|
43337
43278
|
justifyContent: "space-between",
|
|
43338
43279
|
padding: "12px 16px",
|
|
43339
43280
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
43340
|
-
}, children: [(0,
|
|
43281
|
+
}, children: [(0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [(0, import_jsx_runtime49.jsx)("span", { style: { fontWeight: fontWeight.semibold, color: colors.gray[900] }, children: "Notifications" }), unreadCount > 0 && (0, import_jsx_runtime49.jsx)("span", { style: {
|
|
43341
43282
|
padding: "2px 8px",
|
|
43342
43283
|
borderRadius: "12px",
|
|
43343
43284
|
backgroundColor: colors.primary[100],
|
|
43344
43285
|
color: colors.primary[700],
|
|
43345
43286
|
fontSize: fontSize.xs,
|
|
43346
43287
|
fontWeight: fontWeight.medium
|
|
43347
|
-
}, children: unreadCount })] }), (0,
|
|
43288
|
+
}, children: unreadCount })] }), (0, import_jsx_runtime49.jsxs)("div", { style: { display: "flex", gap: "8px" }, children: [unreadCount > 0 && (0, import_jsx_runtime49.jsx)(Button, { variant: "ghost", size: "sm", onClick: onMarkAllAsRead, children: "Mark all read" }), notifications.length > 0 && (0, import_jsx_runtime49.jsx)(Button, { variant: "ghost", size: "sm", onClick: onClearAll, children: "Clear all" })] })] }), (0, import_jsx_runtime49.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "8px" }, children: loading ? (0, import_jsx_runtime49.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "32px" }, children: (0, import_jsx_runtime49.jsx)(Spinner, { size: 24 }) }) : notifications.length === 0 ? (0, import_jsx_runtime49.jsx)("div", { style: { textAlign: "center", padding: "32px", color: colors.gray[500] }, children: emptyText }) : (0, import_jsx_runtime49.jsx)("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: notifications.map((notification) => (0, import_jsx_runtime49.jsx)(NotificationItem, { notification, onMarkAsRead, onDismiss }, notification.id)) }) })] });
|
|
43348
43289
|
}
|
|
43349
43290
|
var sizeWidths = {
|
|
43350
43291
|
sm: "400px",
|
|
@@ -43354,12 +43295,12 @@ var sizeWidths = {
|
|
|
43354
43295
|
full: "100vw"
|
|
43355
43296
|
};
|
|
43356
43297
|
function Modal({ open, onClose, title, children, footer, size = "md", closeOnOverlayClick = true, closeOnEscape = true, showCloseButton = true, style, className }) {
|
|
43357
|
-
const handleEscape = (0,
|
|
43298
|
+
const handleEscape = (0, import_react35.useCallback)((e) => {
|
|
43358
43299
|
if (e.key === "Escape" && closeOnEscape) {
|
|
43359
43300
|
onClose();
|
|
43360
43301
|
}
|
|
43361
43302
|
}, [closeOnEscape, onClose]);
|
|
43362
|
-
(0,
|
|
43303
|
+
(0, import_react35.useEffect)(() => {
|
|
43363
43304
|
if (open) {
|
|
43364
43305
|
document.addEventListener("keydown", handleEscape);
|
|
43365
43306
|
document.body.style.overflow = "hidden";
|
|
@@ -43377,7 +43318,7 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43377
43318
|
}
|
|
43378
43319
|
};
|
|
43379
43320
|
const isFullscreen = size === "full";
|
|
43380
|
-
return (0,
|
|
43321
|
+
return (0, import_jsx_runtime50.jsxs)("div", { style: {
|
|
43381
43322
|
position: "fixed",
|
|
43382
43323
|
inset: 0,
|
|
43383
43324
|
zIndex: zIndex.modal,
|
|
@@ -43385,12 +43326,12 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43385
43326
|
alignItems: isFullscreen ? "stretch" : "center",
|
|
43386
43327
|
justifyContent: "center",
|
|
43387
43328
|
padding: isFullscreen ? 0 : "24px"
|
|
43388
|
-
}, children: [(0,
|
|
43329
|
+
}, children: [(0, import_jsx_runtime50.jsx)("div", { onClick: handleOverlayClick, style: {
|
|
43389
43330
|
position: "absolute",
|
|
43390
43331
|
inset: 0,
|
|
43391
43332
|
backgroundColor: "rgba(0, 0, 0, 0.5)",
|
|
43392
43333
|
animation: animation.fadeIn
|
|
43393
|
-
} }), (0,
|
|
43334
|
+
} }), (0, import_jsx_runtime50.jsxs)("div", { role: "dialog", "aria-modal": "true", className, style: {
|
|
43394
43335
|
position: "relative",
|
|
43395
43336
|
width: sizeWidths[size],
|
|
43396
43337
|
maxWidth: isFullscreen ? "100%" : "calc(100vw - 48px)",
|
|
@@ -43403,17 +43344,17 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43403
43344
|
overflow: "hidden",
|
|
43404
43345
|
animation: animation.scaleIn,
|
|
43405
43346
|
...style
|
|
43406
|
-
}, children: [(title || showCloseButton) && (0,
|
|
43347
|
+
}, children: [(title || showCloseButton) && (0, import_jsx_runtime50.jsxs)("div", { style: {
|
|
43407
43348
|
display: "flex",
|
|
43408
43349
|
alignItems: "center",
|
|
43409
43350
|
justifyContent: "space-between",
|
|
43410
43351
|
padding: "16px 20px",
|
|
43411
43352
|
borderBottom: `1px solid ${colors.gray[200]}`
|
|
43412
|
-
}, children: [title && (0,
|
|
43353
|
+
}, children: [title && (0, import_jsx_runtime50.jsx)(Heading, { level: 4, children: title }), showCloseButton && (0, import_jsx_runtime50.jsx)(Button, { variant: "ghost", size: "sm", onClick: onClose, "aria-label": "Close modal", style: { marginLeft: "auto" }, children: (0, import_jsx_runtime50.jsx)(Icon, { name: "x", size: 20 }) })] }), (0, import_jsx_runtime50.jsx)("div", { style: {
|
|
43413
43354
|
flex: 1,
|
|
43414
43355
|
padding: "20px",
|
|
43415
43356
|
overflowY: "auto"
|
|
43416
|
-
}, children }), footer && (0,
|
|
43357
|
+
}, children }), footer && (0, import_jsx_runtime50.jsx)("div", { style: {
|
|
43417
43358
|
display: "flex",
|
|
43418
43359
|
alignItems: "center",
|
|
43419
43360
|
justifyContent: "flex-end",
|
|
@@ -43423,9 +43364,9 @@ function Modal({ open, onClose, title, children, footer, size = "md", closeOnOve
|
|
|
43423
43364
|
}, children: footer })] })] });
|
|
43424
43365
|
}
|
|
43425
43366
|
function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Search commands...", recentIds = [], loading, style, className }) {
|
|
43426
|
-
const [query, setQuery] = (0,
|
|
43427
|
-
const [selectedIndex, setSelectedIndex] = (0,
|
|
43428
|
-
const filteredCommands = (0,
|
|
43367
|
+
const [query, setQuery] = (0, import_react36.useState)("");
|
|
43368
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react36.useState)(0);
|
|
43369
|
+
const filteredCommands = (0, import_react36.useMemo)(() => {
|
|
43429
43370
|
const filtered = query ? commands.filter((cmd) => cmd.label.toLowerCase().includes(query.toLowerCase()) || cmd.description?.toLowerCase().includes(query.toLowerCase())) : commands;
|
|
43430
43371
|
const groups = /* @__PURE__ */ new Map();
|
|
43431
43372
|
if (!query && recentIds.length > 0) {
|
|
@@ -43446,21 +43387,21 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43446
43387
|
});
|
|
43447
43388
|
return groups;
|
|
43448
43389
|
}, [commands, query, recentIds]);
|
|
43449
|
-
const flatCommands = (0,
|
|
43390
|
+
const flatCommands = (0, import_react36.useMemo)(() => {
|
|
43450
43391
|
const flat = [];
|
|
43451
43392
|
filteredCommands.forEach((cmds) => flat.push(...cmds));
|
|
43452
43393
|
return flat;
|
|
43453
43394
|
}, [filteredCommands]);
|
|
43454
|
-
(0,
|
|
43395
|
+
(0, import_react36.useEffect)(() => {
|
|
43455
43396
|
setSelectedIndex(0);
|
|
43456
43397
|
}, [query]);
|
|
43457
|
-
(0,
|
|
43398
|
+
(0, import_react36.useEffect)(() => {
|
|
43458
43399
|
if (open) {
|
|
43459
43400
|
setQuery("");
|
|
43460
43401
|
setSelectedIndex(0);
|
|
43461
43402
|
}
|
|
43462
43403
|
}, [open]);
|
|
43463
|
-
const handleKeyDown = (0,
|
|
43404
|
+
const handleKeyDown = (0, import_react36.useCallback)((e) => {
|
|
43464
43405
|
if (e.key === "Escape") {
|
|
43465
43406
|
onClose();
|
|
43466
43407
|
return;
|
|
@@ -43480,7 +43421,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43480
43421
|
}
|
|
43481
43422
|
}
|
|
43482
43423
|
}, [flatCommands, selectedIndex, onSelect, onClose]);
|
|
43483
|
-
(0,
|
|
43424
|
+
(0, import_react36.useEffect)(() => {
|
|
43484
43425
|
if (open) {
|
|
43485
43426
|
document.addEventListener("keydown", handleKeyDown);
|
|
43486
43427
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
@@ -43489,7 +43430,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43489
43430
|
if (!open)
|
|
43490
43431
|
return null;
|
|
43491
43432
|
let currentIndex = 0;
|
|
43492
|
-
return (0,
|
|
43433
|
+
return (0, import_jsx_runtime51.jsxs)("div", { style: {
|
|
43493
43434
|
position: "fixed",
|
|
43494
43435
|
inset: 0,
|
|
43495
43436
|
zIndex: zIndex.modal,
|
|
@@ -43497,11 +43438,11 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43497
43438
|
alignItems: "flex-start",
|
|
43498
43439
|
justifyContent: "center",
|
|
43499
43440
|
paddingTop: "15vh"
|
|
43500
|
-
}, children: [(0,
|
|
43441
|
+
}, children: [(0, import_jsx_runtime51.jsx)("div", { onClick: onClose, style: {
|
|
43501
43442
|
position: "absolute",
|
|
43502
43443
|
inset: 0,
|
|
43503
43444
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
43504
|
-
} }), (0,
|
|
43445
|
+
} }), (0, import_jsx_runtime51.jsxs)("div", { role: "dialog", className, style: {
|
|
43505
43446
|
position: "relative",
|
|
43506
43447
|
width: "560px",
|
|
43507
43448
|
maxWidth: "calc(100vw - 48px)",
|
|
@@ -43513,19 +43454,19 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43513
43454
|
display: "flex",
|
|
43514
43455
|
flexDirection: "column",
|
|
43515
43456
|
...style
|
|
43516
|
-
}, children: [(0,
|
|
43457
|
+
}, children: [(0, import_jsx_runtime51.jsx)("div", { style: { padding: "12px", borderBottom: `1px solid ${colors.gray[200]}` }, children: (0, import_jsx_runtime51.jsxs)("div", { style: { position: "relative" }, children: [(0, import_jsx_runtime51.jsx)(Icon, { name: "search", size: 18, tone: "subtle", style: {
|
|
43517
43458
|
position: "absolute",
|
|
43518
43459
|
left: "12px",
|
|
43519
43460
|
top: "50%",
|
|
43520
43461
|
transform: "translateY(-50%)"
|
|
43521
|
-
} }), (0,
|
|
43462
|
+
} }), (0, import_jsx_runtime51.jsx)("input", { type: "text", value: query, onChange: (e) => setQuery(e.target.value), placeholder, autoFocus: true, style: {
|
|
43522
43463
|
width: "100%",
|
|
43523
43464
|
padding: "12px 12px 12px 42px",
|
|
43524
43465
|
border: "none",
|
|
43525
43466
|
fontSize: fontSize.base,
|
|
43526
43467
|
outline: "none",
|
|
43527
43468
|
backgroundColor: "transparent"
|
|
43528
|
-
} })] }) }), (0,
|
|
43469
|
+
} })] }) }), (0, import_jsx_runtime51.jsx)("div", { style: { flex: 1, overflowY: "auto", padding: "8px" }, children: loading ? (0, import_jsx_runtime51.jsx)("div", { style: { display: "flex", justifyContent: "center", padding: "32px" }, children: (0, import_jsx_runtime51.jsx)(Spinner, { size: 24 }) }) : flatCommands.length === 0 ? (0, import_jsx_runtime51.jsx)("div", { style: { textAlign: "center", padding: "32px", color: colors.gray[500] }, children: "No commands found" }) : Array.from(filteredCommands.entries()).map(([group, cmds]) => (0, import_jsx_runtime51.jsxs)("div", { style: { marginBottom: "8px" }, children: [(0, import_jsx_runtime51.jsx)("div", { style: {
|
|
43529
43470
|
padding: "8px 12px",
|
|
43530
43471
|
fontSize: fontSize.xs,
|
|
43531
43472
|
fontWeight: fontWeight.semibold,
|
|
@@ -43535,7 +43476,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43535
43476
|
}, children: group }), cmds.map((cmd) => {
|
|
43536
43477
|
const index = currentIndex++;
|
|
43537
43478
|
const isSelected = index === selectedIndex;
|
|
43538
|
-
return (0,
|
|
43479
|
+
return (0, import_jsx_runtime51.jsxs)("button", { onClick: () => {
|
|
43539
43480
|
if (!cmd.disabled) {
|
|
43540
43481
|
onSelect(cmd);
|
|
43541
43482
|
onClose();
|
|
@@ -43552,7 +43493,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43552
43493
|
color: cmd.disabled ? colors.gray[400] : colors.gray[900],
|
|
43553
43494
|
textAlign: "left",
|
|
43554
43495
|
cursor: cmd.disabled ? "not-allowed" : "pointer"
|
|
43555
|
-
}, children: [cmd.icon && (0,
|
|
43496
|
+
}, children: [cmd.icon && (0, import_jsx_runtime51.jsx)("span", { style: { display: "flex", color: colors.gray[500] }, children: cmd.icon }), (0, import_jsx_runtime51.jsxs)("div", { style: { flex: 1 }, children: [(0, import_jsx_runtime51.jsx)("div", { style: { fontSize: fontSize.sm }, children: cmd.label }), cmd.description && (0, import_jsx_runtime51.jsx)("div", { style: { fontSize: fontSize.xs, color: colors.gray[500] }, children: cmd.description })] }), cmd.shortcut && (0, import_jsx_runtime51.jsx)("kbd", { style: {
|
|
43556
43497
|
padding: "2px 6px",
|
|
43557
43498
|
backgroundColor: colors.gray[100],
|
|
43558
43499
|
borderRadius: radius.sm,
|
|
@@ -43560,7 +43501,7 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43560
43501
|
color: colors.gray[500],
|
|
43561
43502
|
fontFamily: "inherit"
|
|
43562
43503
|
}, children: cmd.shortcut })] }, cmd.id);
|
|
43563
|
-
})] }, group)) }), (0,
|
|
43504
|
+
})] }, group)) }), (0, import_jsx_runtime51.jsxs)("div", { style: {
|
|
43564
43505
|
padding: "8px 12px",
|
|
43565
43506
|
borderTop: `1px solid ${colors.gray[200]}`,
|
|
43566
43507
|
display: "flex",
|
|
@@ -43568,35 +43509,35 @@ function CommandPalette({ open, onClose, commands, onSelect, placeholder = "Sear
|
|
|
43568
43509
|
gap: "16px",
|
|
43569
43510
|
fontSize: fontSize.xs,
|
|
43570
43511
|
color: colors.gray[500]
|
|
43571
|
-
}, children: [(0,
|
|
43512
|
+
}, children: [(0, import_jsx_runtime51.jsx)("span", { children: "\u2191\u2193 Navigate" }), (0, import_jsx_runtime51.jsx)("span", { children: "\u21B5 Select" }), (0, import_jsx_runtime51.jsx)("span", { children: "Esc Close" })] })] })] });
|
|
43572
43513
|
}
|
|
43573
43514
|
function Footer({ brand, columns, socialLinks, bottomText, bottomLinks, background, bordered = true, style, className }) {
|
|
43574
|
-
return (0,
|
|
43515
|
+
return (0, import_jsx_runtime52.jsxs)("footer", { className, role: "contentinfo", style: {
|
|
43575
43516
|
backgroundColor: background || colors.gray[50],
|
|
43576
43517
|
borderTop: bordered ? `1px solid ${colors.gray[200]}` : void 0,
|
|
43577
43518
|
...style
|
|
43578
|
-
}, children: [(0,
|
|
43519
|
+
}, children: [(0, import_jsx_runtime52.jsxs)("div", { style: {
|
|
43579
43520
|
display: "flex",
|
|
43580
43521
|
flexWrap: "wrap",
|
|
43581
43522
|
gap: "48px",
|
|
43582
43523
|
padding: "48px 24px",
|
|
43583
43524
|
maxWidth: "1280px",
|
|
43584
43525
|
margin: "0 auto"
|
|
43585
|
-
}, children: [brand && (0,
|
|
43526
|
+
}, children: [brand && (0, import_jsx_runtime52.jsx)("div", { style: { flex: "1 1 280px", minWidth: "200px" }, children: brand }), columns?.map((column, colIdx) => (0, import_jsx_runtime52.jsxs)("div", { style: { flex: "0 1 180px", minWidth: "140px" }, children: [column.title && (0, import_jsx_runtime52.jsx)("h4", { style: {
|
|
43586
43527
|
fontSize: fontSize.sm,
|
|
43587
43528
|
fontWeight: fontWeight.semibold,
|
|
43588
43529
|
color: colors.gray[900],
|
|
43589
43530
|
lineHeight: lineHeight.normal,
|
|
43590
43531
|
margin: "0 0 16px 0",
|
|
43591
43532
|
padding: 0
|
|
43592
|
-
}, children: column.title }), (0,
|
|
43533
|
+
}, children: column.title }), (0, import_jsx_runtime52.jsx)("ul", { style: {
|
|
43593
43534
|
listStyle: "none",
|
|
43594
43535
|
margin: 0,
|
|
43595
43536
|
padding: 0,
|
|
43596
43537
|
display: "flex",
|
|
43597
43538
|
flexDirection: "column",
|
|
43598
43539
|
gap: "10px"
|
|
43599
|
-
}, children: column.links.map((link, linkIdx) => (0,
|
|
43540
|
+
}, children: column.links.map((link, linkIdx) => (0, import_jsx_runtime52.jsx)("li", { children: (0, import_jsx_runtime52.jsx)("a", { href: link.href, onClick: link.onClick ? (e) => {
|
|
43600
43541
|
e.preventDefault();
|
|
43601
43542
|
link.onClick?.();
|
|
43602
43543
|
} : void 0, style: {
|
|
@@ -43605,7 +43546,7 @@ function Footer({ brand, columns, socialLinks, bottomText, bottomLinks, backgrou
|
|
|
43605
43546
|
textDecoration: "none",
|
|
43606
43547
|
transition: "color 0.15s",
|
|
43607
43548
|
lineHeight: lineHeight.normal
|
|
43608
|
-
}, "aria-label": link.label, children: link.label }) }, linkIdx)) })] }, colIdx))] }), (bottomText || bottomLinks || socialLinks) && (0,
|
|
43549
|
+
}, "aria-label": link.label, children: link.label }) }, linkIdx)) })] }, colIdx))] }), (bottomText || bottomLinks || socialLinks) && (0, import_jsx_runtime52.jsxs)("div", { style: {
|
|
43609
43550
|
display: "flex",
|
|
43610
43551
|
flexWrap: "wrap",
|
|
43611
43552
|
alignItems: "center",
|
|
@@ -43615,17 +43556,17 @@ function Footer({ brand, columns, socialLinks, bottomText, bottomLinks, backgrou
|
|
|
43615
43556
|
maxWidth: "1280px",
|
|
43616
43557
|
margin: "0 auto",
|
|
43617
43558
|
borderTop: `1px solid ${colors.gray[200]}`
|
|
43618
|
-
}, children: [bottomText && (0,
|
|
43559
|
+
}, children: [bottomText && (0, import_jsx_runtime52.jsx)("span", { style: {
|
|
43619
43560
|
fontSize: fontSize.sm,
|
|
43620
43561
|
color: colors.gray[500],
|
|
43621
43562
|
lineHeight: lineHeight.normal
|
|
43622
|
-
}, children: bottomText }), (0,
|
|
43563
|
+
}, children: bottomText }), (0, import_jsx_runtime52.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "20px" }, children: [socialLinks?.map((social, idx) => (0, import_jsx_runtime52.jsx)("a", { href: social.href, "aria-label": social.label, style: {
|
|
43623
43564
|
display: "flex",
|
|
43624
43565
|
alignItems: "center",
|
|
43625
43566
|
justifyContent: "center",
|
|
43626
43567
|
color: colors.gray[500],
|
|
43627
43568
|
transition: "color 0.15s"
|
|
43628
|
-
}, children: social.icon }, idx)), bottomLinks?.map((link, idx) => (0,
|
|
43569
|
+
}, children: social.icon }, idx)), bottomLinks?.map((link, idx) => (0, import_jsx_runtime52.jsx)("a", { href: link.href, onClick: link.onClick ? (e) => {
|
|
43629
43570
|
e.preventDefault();
|
|
43630
43571
|
link.onClick?.();
|
|
43631
43572
|
} : void 0, style: {
|
|
@@ -43644,7 +43585,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43644
43585
|
const sizeConfig2 = sizeStyles7[size] || sizeStyles7.md;
|
|
43645
43586
|
const hasImage = !!backgroundImage;
|
|
43646
43587
|
const showOverlay = hasImage && overlay;
|
|
43647
|
-
return (0,
|
|
43588
|
+
return (0, import_jsx_runtime53.jsxs)("section", { className, style: {
|
|
43648
43589
|
position: "relative",
|
|
43649
43590
|
backgroundColor: background || (hasImage ? void 0 : colors.white),
|
|
43650
43591
|
...hasImage && {
|
|
@@ -43654,11 +43595,11 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43654
43595
|
},
|
|
43655
43596
|
overflow: "hidden",
|
|
43656
43597
|
...style
|
|
43657
|
-
}, children: [showOverlay && (0,
|
|
43598
|
+
}, children: [showOverlay && (0, import_jsx_runtime53.jsx)("div", { "aria-hidden": "true", style: {
|
|
43658
43599
|
position: "absolute",
|
|
43659
43600
|
inset: 0,
|
|
43660
43601
|
backgroundColor: "rgba(0, 0, 0, 0.5)"
|
|
43661
|
-
} }), (0,
|
|
43602
|
+
} }), (0, import_jsx_runtime53.jsxs)("div", { style: {
|
|
43662
43603
|
position: "relative",
|
|
43663
43604
|
maxWidth: "1280px",
|
|
43664
43605
|
margin: "0 auto",
|
|
@@ -43668,10 +43609,10 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43668
43609
|
alignItems: align === "center" ? "center" : "center",
|
|
43669
43610
|
gap: "48px",
|
|
43670
43611
|
textAlign: align === "center" ? "center" : "left"
|
|
43671
|
-
}, children: [(0,
|
|
43612
|
+
}, children: [(0, import_jsx_runtime53.jsxs)("div", { style: {
|
|
43672
43613
|
flex: align === "left" && media ? "1 1 50%" : void 0,
|
|
43673
43614
|
maxWidth: align === "center" ? "800px" : void 0
|
|
43674
|
-
}, children: [heading && (0,
|
|
43615
|
+
}, children: [heading && (0, import_jsx_runtime53.jsx)("h1", { style: {
|
|
43675
43616
|
fontSize: sizeConfig2.headingSize,
|
|
43676
43617
|
fontWeight: fontWeight.bold,
|
|
43677
43618
|
lineHeight: lineHeight.tight,
|
|
@@ -43679,7 +43620,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43679
43620
|
color: showOverlay ? colors.white : colors.gray[900],
|
|
43680
43621
|
margin: "0 0 16px 0",
|
|
43681
43622
|
padding: 0
|
|
43682
|
-
}, children: heading }), description && (0,
|
|
43623
|
+
}, children: heading }), description && (0, import_jsx_runtime53.jsx)("p", { style: {
|
|
43683
43624
|
fontSize: sizeConfig2.descSize,
|
|
43684
43625
|
lineHeight: lineHeight.relaxed,
|
|
43685
43626
|
color: showOverlay ? "rgba(255,255,255,0.9)" : colors.gray[600],
|
|
@@ -43687,12 +43628,12 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43687
43628
|
padding: 0,
|
|
43688
43629
|
maxWidth: align === "center" ? "640px" : void 0,
|
|
43689
43630
|
...align === "center" && { marginLeft: "auto", marginRight: "auto" }
|
|
43690
|
-
}, children: description }), (primaryAction || secondaryAction) && (0,
|
|
43631
|
+
}, children: description }), (primaryAction || secondaryAction) && (0, import_jsx_runtime53.jsxs)("div", { style: {
|
|
43691
43632
|
display: "flex",
|
|
43692
43633
|
flexWrap: "wrap",
|
|
43693
43634
|
gap: "12px",
|
|
43694
43635
|
justifyContent: align === "center" ? "center" : "flex-start"
|
|
43695
|
-
}, children: [primaryAction && (0,
|
|
43636
|
+
}, children: [primaryAction && (0, import_jsx_runtime53.jsx)("button", { onClick: primaryAction.onClick, style: {
|
|
43696
43637
|
padding: "12px 28px",
|
|
43697
43638
|
fontSize: fontSize.base,
|
|
43698
43639
|
fontWeight: fontWeight.semibold,
|
|
@@ -43703,7 +43644,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43703
43644
|
cursor: "pointer",
|
|
43704
43645
|
transition: "background-color 0.15s",
|
|
43705
43646
|
lineHeight: lineHeight.normal
|
|
43706
|
-
}, children: primaryAction.label }), secondaryAction && (0,
|
|
43647
|
+
}, children: primaryAction.label }), secondaryAction && (0, import_jsx_runtime53.jsx)("button", { onClick: secondaryAction.onClick, style: {
|
|
43707
43648
|
padding: "12px 28px",
|
|
43708
43649
|
fontSize: fontSize.base,
|
|
43709
43650
|
fontWeight: fontWeight.semibold,
|
|
@@ -43714,7 +43655,7 @@ function Hero({ heading, description, primaryAction, secondaryAction, media, ali
|
|
|
43714
43655
|
cursor: "pointer",
|
|
43715
43656
|
transition: "all 0.15s",
|
|
43716
43657
|
lineHeight: lineHeight.normal
|
|
43717
|
-
}, children: secondaryAction.label })] })] }), media && (0,
|
|
43658
|
+
}, children: secondaryAction.label })] })] }), media && (0, import_jsx_runtime53.jsx)("div", { style: {
|
|
43718
43659
|
flex: align === "left" ? "1 1 50%" : void 0,
|
|
43719
43660
|
display: "flex",
|
|
43720
43661
|
justifyContent: "center",
|
|
@@ -43728,9 +43669,9 @@ __export2(interact_exports, {
|
|
|
43728
43669
|
Hoverable: () => Hoverable,
|
|
43729
43670
|
Pressable: () => Pressable
|
|
43730
43671
|
});
|
|
43731
|
-
var Clickable = (0,
|
|
43732
|
-
const [hovered, setHovered] = (0,
|
|
43733
|
-
const [active, setActive] = (0,
|
|
43672
|
+
var Clickable = (0, import_react37.forwardRef)(function Clickable2({ children, onClick, onDoubleClick, hoverStyle, activeStyle, cursor, transition: transition2 = "all 200ms ease", disabled = false, role, "aria-label": ariaLabel, tabIndex, style, className, ...rest }, ref) {
|
|
43673
|
+
const [hovered, setHovered] = (0, import_react37.useState)(false);
|
|
43674
|
+
const [active, setActive] = (0, import_react37.useState)(false);
|
|
43734
43675
|
const hasClick = !!onClick;
|
|
43735
43676
|
const resolvedCursor = disabled ? "not-allowed" : cursor ?? (hasClick ? "pointer" : void 0);
|
|
43736
43677
|
const resolvedRole = role ?? (hasClick ? "button" : void 0);
|
|
@@ -43751,19 +43692,19 @@ var Clickable = (0, import_react42.forwardRef)(function Clickable2({ children, o
|
|
|
43751
43692
|
...hovered && !disabled ? hoverStyle : {},
|
|
43752
43693
|
...active && !disabled ? activeStyle : {}
|
|
43753
43694
|
};
|
|
43754
|
-
return (0,
|
|
43695
|
+
return (0, import_jsx_runtime54.jsx)("div", { ref, className, style: mergedStyle, onClick: disabled ? void 0 : onClick, onDoubleClick: disabled ? void 0 : onDoubleClick, onMouseEnter: () => setHovered(true), onMouseLeave: () => {
|
|
43755
43696
|
setHovered(false);
|
|
43756
43697
|
setActive(false);
|
|
43757
43698
|
}, onMouseDown: () => setActive(true), onMouseUp: () => setActive(false), onKeyDown: handleKeyDown, role: resolvedRole, "aria-label": ariaLabel, "aria-disabled": disabled || void 0, tabIndex: resolvedTabIndex, ...rest, children });
|
|
43758
43699
|
});
|
|
43759
|
-
var Hoverable = (0,
|
|
43760
|
-
const [hovered, setHovered] = (0,
|
|
43700
|
+
var Hoverable = (0, import_react38.forwardRef)(function Hoverable2({ children, hoverStyle, onHoverChange, transition: transition2 = "all 200ms ease", style, className, ...rest }, ref) {
|
|
43701
|
+
const [hovered, setHovered] = (0, import_react38.useState)(false);
|
|
43761
43702
|
const mergedStyle = {
|
|
43762
43703
|
...style,
|
|
43763
43704
|
transition: transition2,
|
|
43764
43705
|
...hovered ? hoverStyle : {}
|
|
43765
43706
|
};
|
|
43766
|
-
return (0,
|
|
43707
|
+
return (0, import_jsx_runtime55.jsx)("div", { ref, className, style: mergedStyle, onMouseEnter: () => {
|
|
43767
43708
|
setHovered(true);
|
|
43768
43709
|
onHoverChange?.(true);
|
|
43769
43710
|
}, onMouseLeave: () => {
|
|
@@ -43771,10 +43712,10 @@ var Hoverable = (0, import_react43.forwardRef)(function Hoverable2({ children, h
|
|
|
43771
43712
|
onHoverChange?.(false);
|
|
43772
43713
|
}, ...rest, children });
|
|
43773
43714
|
});
|
|
43774
|
-
var Pressable = (0,
|
|
43775
|
-
const [hovered, setHovered] = (0,
|
|
43776
|
-
const [pressed, setPressed] = (0,
|
|
43777
|
-
const [longPressTimer, setLongPressTimer] = (0,
|
|
43715
|
+
var Pressable = (0, import_react39.forwardRef)(function Pressable2({ children, onPress, onLongPress, longPressDelay = 500, hoverStyle, pressStyle, disabled = false, transition: transition2 = "all 150ms ease", role, "aria-label": ariaLabel, tabIndex, style, className, ...rest }, ref) {
|
|
43716
|
+
const [hovered, setHovered] = (0, import_react39.useState)(false);
|
|
43717
|
+
const [pressed, setPressed] = (0, import_react39.useState)(false);
|
|
43718
|
+
const [longPressTimer, setLongPressTimer] = (0, import_react39.useState)(null);
|
|
43778
43719
|
const hasPress = !!onPress || !!onLongPress;
|
|
43779
43720
|
const handleMouseDown = (e) => {
|
|
43780
43721
|
if (disabled)
|
|
@@ -43817,7 +43758,7 @@ var Pressable = (0, import_react44.forwardRef)(function Pressable2({ children, o
|
|
|
43817
43758
|
...pressed && !disabled ? pressStyle : {}
|
|
43818
43759
|
};
|
|
43819
43760
|
const content = typeof children === "function" ? children({ pressed, hovered }) : children;
|
|
43820
|
-
return (0,
|
|
43761
|
+
return (0, import_jsx_runtime56.jsx)("div", { ref, className, style: mergedStyle, onMouseDown: handleMouseDown, onMouseUp: handleMouseUp, onMouseEnter: () => setHovered(true), onMouseLeave: () => {
|
|
43821
43762
|
setHovered(false);
|
|
43822
43763
|
setPressed(false);
|
|
43823
43764
|
if (longPressTimer)
|
|
@@ -46661,7 +46602,7 @@ function getTheme(id, mode = "light") {
|
|
|
46661
46602
|
function getDefaultThemeId() {
|
|
46662
46603
|
return "ggui";
|
|
46663
46604
|
}
|
|
46664
|
-
var ThemeContext = (0,
|
|
46605
|
+
var ThemeContext = (0, import_react40.createContext)(null);
|
|
46665
46606
|
var COLOR_MIX_SUPPORTS = "@supports (color: color-mix(in srgb, red, blue))";
|
|
46666
46607
|
function resolvePrimary500Hex(cssVariables) {
|
|
46667
46608
|
const match = cssVariables.match(/--ggui-color-primary-500:\s*(#[0-9a-fA-F]{3}|#[0-9a-fA-F]{6})\s*;/);
|
|
@@ -47153,7 +47094,7 @@ function makeScopeClass(reactId) {
|
|
|
47153
47094
|
}
|
|
47154
47095
|
var AUTO_RETRY_LIMIT = 1;
|
|
47155
47096
|
var AUTO_RETRY_DELAY = 500;
|
|
47156
|
-
var ErrorBoundary = class extends
|
|
47097
|
+
var ErrorBoundary = class extends import_react7.default.Component {
|
|
47157
47098
|
state = { error: null, catchCount: 0, autoRetrying: false };
|
|
47158
47099
|
retryTimer = null;
|
|
47159
47100
|
static getDerivedStateFromError(error210) {
|
|
@@ -47175,10 +47116,10 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47175
47116
|
if (this.retryTimer) clearTimeout(this.retryTimer);
|
|
47176
47117
|
}
|
|
47177
47118
|
render() {
|
|
47178
|
-
const { error: error210, autoRetrying
|
|
47119
|
+
const { error: error210, autoRetrying } = this.state;
|
|
47179
47120
|
if (!error210) return this.props.children;
|
|
47180
47121
|
if (autoRetrying) {
|
|
47181
|
-
return /* @__PURE__ */ (0,
|
|
47122
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: {
|
|
47182
47123
|
display: "flex",
|
|
47183
47124
|
alignItems: "center",
|
|
47184
47125
|
justifyContent: "center",
|
|
@@ -47187,21 +47128,22 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47187
47128
|
gap: 8,
|
|
47188
47129
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
47189
47130
|
fontSize: 13,
|
|
47190
|
-
color: "
|
|
47131
|
+
color: "var(--ggui-color-onSurface, inherit)",
|
|
47132
|
+
opacity: 0.6
|
|
47191
47133
|
}, children: [
|
|
47192
|
-
/* @__PURE__ */ (0,
|
|
47134
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
47193
47135
|
width: 16,
|
|
47194
47136
|
height: 16,
|
|
47195
|
-
border: "2px solid rgba(
|
|
47196
|
-
borderTopColor: "
|
|
47137
|
+
border: "2px solid rgba(128,128,128,0.25)",
|
|
47138
|
+
borderTopColor: "currentColor",
|
|
47197
47139
|
borderRadius: "50%",
|
|
47198
47140
|
animation: "ggui-err-spin 0.6s linear infinite"
|
|
47199
47141
|
} }),
|
|
47200
47142
|
"Retrying...",
|
|
47201
|
-
/* @__PURE__ */ (0,
|
|
47143
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("style", { children: `@keyframes ggui-err-spin { to { transform: rotate(360deg); } }` })
|
|
47202
47144
|
] });
|
|
47203
47145
|
}
|
|
47204
|
-
return /* @__PURE__ */ (0,
|
|
47146
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: {
|
|
47205
47147
|
display: "flex",
|
|
47206
47148
|
flexDirection: "column",
|
|
47207
47149
|
alignItems: "center",
|
|
@@ -47210,21 +47152,23 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47210
47152
|
minHeight: 120,
|
|
47211
47153
|
gap: 12,
|
|
47212
47154
|
textAlign: "center",
|
|
47213
|
-
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
47155
|
+
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
47156
|
+
color: "var(--ggui-color-onSurface, inherit)"
|
|
47214
47157
|
}, children: [
|
|
47215
|
-
/* @__PURE__ */ (0,
|
|
47158
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
47216
47159
|
width: 48,
|
|
47217
47160
|
height: 48,
|
|
47218
47161
|
borderRadius: 14,
|
|
47219
47162
|
background: "rgba(239, 68, 68, 0.1)",
|
|
47163
|
+
color: "#ef4444",
|
|
47220
47164
|
display: "flex",
|
|
47221
47165
|
alignItems: "center",
|
|
47222
47166
|
justifyContent: "center",
|
|
47223
47167
|
fontSize: 22
|
|
47224
47168
|
}, children: "!" }),
|
|
47225
|
-
/* @__PURE__ */ (0,
|
|
47226
|
-
/* @__PURE__ */ (0,
|
|
47227
|
-
/* @__PURE__ */ (0,
|
|
47169
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 14, fontWeight: 600, opacity: 0.9 }, children: "Something went wrong" }),
|
|
47170
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 12, opacity: 0.6, maxWidth: 280, lineHeight: 1.4 }, children: "This component encountered an error. Try asking for a different view." }),
|
|
47171
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
|
|
47228
47172
|
"button",
|
|
47229
47173
|
{
|
|
47230
47174
|
onClick: () => this.setState({ error: null, catchCount: 0 }),
|
|
@@ -47232,9 +47176,10 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47232
47176
|
marginTop: 4,
|
|
47233
47177
|
padding: "8px 20px",
|
|
47234
47178
|
borderRadius: 8,
|
|
47235
|
-
border: "1px solid
|
|
47236
|
-
background: "
|
|
47237
|
-
color: "
|
|
47179
|
+
border: "1px solid currentColor",
|
|
47180
|
+
background: "transparent",
|
|
47181
|
+
color: "inherit",
|
|
47182
|
+
opacity: 0.75,
|
|
47238
47183
|
fontSize: 13,
|
|
47239
47184
|
fontWeight: 500,
|
|
47240
47185
|
cursor: "pointer"
|
|
@@ -47242,7 +47187,18 @@ var ErrorBoundary = class extends import_react12.default.Component {
|
|
|
47242
47187
|
children: "Retry"
|
|
47243
47188
|
}
|
|
47244
47189
|
),
|
|
47245
|
-
|
|
47190
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("details", { style: { marginTop: 8, maxWidth: 320, width: "100%", textAlign: "left", opacity: 0.65 }, children: [
|
|
47191
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("summary", { style: { fontSize: 11, cursor: "pointer" }, children: "Error details" }),
|
|
47192
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("pre", { style: {
|
|
47193
|
+
fontSize: 11,
|
|
47194
|
+
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
47195
|
+
whiteSpace: "pre-wrap",
|
|
47196
|
+
overflowWrap: "anywhere",
|
|
47197
|
+
margin: "6px 0 0",
|
|
47198
|
+
maxHeight: 140,
|
|
47199
|
+
overflow: "auto"
|
|
47200
|
+
}, children: error210.message })
|
|
47201
|
+
] })
|
|
47246
47202
|
] });
|
|
47247
47203
|
}
|
|
47248
47204
|
};
|
|
@@ -47251,15 +47207,15 @@ function ReactComponentRenderer({
|
|
|
47251
47207
|
props = {},
|
|
47252
47208
|
themeId,
|
|
47253
47209
|
cssOverrides,
|
|
47254
|
-
fallback = /* @__PURE__ */ (0,
|
|
47210
|
+
fallback = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: "Loading component..." }),
|
|
47255
47211
|
onError
|
|
47256
47212
|
}) {
|
|
47257
|
-
const reactId = (0,
|
|
47258
|
-
const [scopeClass] = (0,
|
|
47259
|
-
const [
|
|
47260
|
-
const [error210, setError] = (0,
|
|
47261
|
-
const [loading, setLoading] = (0,
|
|
47262
|
-
(0,
|
|
47213
|
+
const reactId = (0, import_react7.useId)();
|
|
47214
|
+
const [scopeClass] = (0, import_react7.useState)(() => makeScopeClass(reactId) || `ggui-rcr-${++scopeCounter}`);
|
|
47215
|
+
const [Component, setComponent] = (0, import_react7.useState)(null);
|
|
47216
|
+
const [error210, setError] = (0, import_react7.useState)(null);
|
|
47217
|
+
const [loading, setLoading] = (0, import_react7.useState)(true);
|
|
47218
|
+
(0, import_react7.useEffect)(() => {
|
|
47263
47219
|
if (!code || code.trim().length === 0) {
|
|
47264
47220
|
setComponent(null);
|
|
47265
47221
|
setLoading(false);
|
|
@@ -47287,7 +47243,7 @@ function ReactComponentRenderer({
|
|
|
47287
47243
|
} catch {
|
|
47288
47244
|
}
|
|
47289
47245
|
w.__ggui__ = {
|
|
47290
|
-
react:
|
|
47246
|
+
react: import_react7.default,
|
|
47291
47247
|
reactDom: reactDomModule,
|
|
47292
47248
|
primitives: primitives_exports,
|
|
47293
47249
|
components: components_exports,
|
|
@@ -47295,7 +47251,7 @@ function ReactComponentRenderer({
|
|
|
47295
47251
|
interact: interact_exports,
|
|
47296
47252
|
wire: dist_exports
|
|
47297
47253
|
};
|
|
47298
|
-
w.__REACT =
|
|
47254
|
+
w.__REACT = import_react7.default;
|
|
47299
47255
|
w.__GGUI_PRIMITIVES = primitives_exports;
|
|
47300
47256
|
w.__GGUI_COMPONENTS = components_exports;
|
|
47301
47257
|
w.__GGUI_COMPOSITIONS = compositions_exports;
|
|
@@ -47331,13 +47287,13 @@ function ReactComponentRenderer({
|
|
|
47331
47287
|
}, [code]);
|
|
47332
47288
|
const themeCss = themeId ? getScopedThemeCss(themeId, scopeClass) : getScopedCssTokens(scopeClass);
|
|
47333
47289
|
if (!code || code.trim().length === 0) {
|
|
47334
|
-
return /* @__PURE__ */ (0,
|
|
47290
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: fallback });
|
|
47335
47291
|
}
|
|
47336
47292
|
if (loading) {
|
|
47337
|
-
return /* @__PURE__ */ (0,
|
|
47293
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: fallback });
|
|
47338
47294
|
}
|
|
47339
47295
|
if (error210) {
|
|
47340
|
-
return /* @__PURE__ */ (0,
|
|
47296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { style: {
|
|
47341
47297
|
display: "flex",
|
|
47342
47298
|
flexDirection: "column",
|
|
47343
47299
|
alignItems: "center",
|
|
@@ -47348,7 +47304,7 @@ function ReactComponentRenderer({
|
|
|
47348
47304
|
textAlign: "center",
|
|
47349
47305
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
|
|
47350
47306
|
}, children: [
|
|
47351
|
-
/* @__PURE__ */ (0,
|
|
47307
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: {
|
|
47352
47308
|
width: 48,
|
|
47353
47309
|
height: 48,
|
|
47354
47310
|
borderRadius: 14,
|
|
@@ -47358,52 +47314,26 @@ function ReactComponentRenderer({
|
|
|
47358
47314
|
justifyContent: "center",
|
|
47359
47315
|
fontSize: 22
|
|
47360
47316
|
}, children: "!" }),
|
|
47361
|
-
/* @__PURE__ */ (0,
|
|
47362
|
-
/* @__PURE__ */ (0,
|
|
47317
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 14, fontWeight: 600, color: "rgba(255,255,255,0.8)" }, children: "Failed to load component" }),
|
|
47318
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { style: { fontSize: 12, color: "rgba(255,255,255,0.4)", maxWidth: 280, lineHeight: 1.4 }, children: error210.message })
|
|
47363
47319
|
] });
|
|
47364
47320
|
}
|
|
47365
|
-
if (!
|
|
47366
|
-
return /* @__PURE__ */ (0,
|
|
47321
|
+
if (!Component) {
|
|
47322
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { children: fallback });
|
|
47367
47323
|
}
|
|
47368
|
-
return /* @__PURE__ */ (0,
|
|
47369
|
-
/* @__PURE__ */ (0,
|
|
47324
|
+
return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { className: scopeClass, children: [
|
|
47325
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("style", { children: [
|
|
47370
47326
|
themeCss,
|
|
47371
47327
|
cssOverrides ?? ""
|
|
47372
47328
|
] }),
|
|
47373
|
-
/* @__PURE__ */ (0,
|
|
47329
|
+
/* @__PURE__ */ (0, import_jsx_runtime58.jsx)(ErrorBoundary, { onError, children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Component, { ...props }) }, code.length)
|
|
47374
47330
|
] });
|
|
47375
47331
|
}
|
|
47376
|
-
var previewShimmerKeyframes = `@keyframes ggui-preview-shimmer {
|
|
47377
|
-
0% { transform: translateX(-100%); }
|
|
47378
|
-
100% { transform: translateX(100%); }
|
|
47379
|
-
}`;
|
|
47380
|
-
var previewCaretKeyframes = `@keyframes ggui-preview-caret {
|
|
47381
|
-
0%, 45% { opacity: 1; }
|
|
47382
|
-
55%, 100% { opacity: 0; }
|
|
47383
|
-
}`;
|
|
47384
|
-
var previewFragmentEnterKeyframes = `@keyframes ggui-preview-fragment-enter {
|
|
47385
|
-
from { opacity: 0; transform: scale(0.97); }
|
|
47386
|
-
to { opacity: 1; transform: scale(1); }
|
|
47387
|
-
}`;
|
|
47388
|
-
var previewReducedMotionCSS = `@media (prefers-reduced-motion: reduce) {
|
|
47389
|
-
[data-ggui-preview] *,
|
|
47390
|
-
[data-ggui-preview]::before,
|
|
47391
|
-
[data-ggui-preview]::after {
|
|
47392
|
-
animation-duration: 0.01ms !important;
|
|
47393
|
-
animation-iteration-count: 1 !important;
|
|
47394
|
-
transition-duration: 0.01ms !important;
|
|
47395
|
-
}
|
|
47396
|
-
}`;
|
|
47397
|
-
var previewKeyframesCss = [
|
|
47398
|
-
previewShimmerKeyframes,
|
|
47399
|
-
previewCaretKeyframes,
|
|
47400
|
-
previewFragmentEnterKeyframes,
|
|
47401
|
-
previewReducedMotionCSS
|
|
47402
|
-
].join("\n\n");
|
|
47403
47332
|
var DynamicComponent = ReactComponentRenderer;
|
|
47333
|
+
var DECODER = new TextDecoder();
|
|
47404
47334
|
|
|
47405
47335
|
// hub-preview-client/main.tsx
|
|
47406
|
-
var
|
|
47336
|
+
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
|
|
47407
47337
|
function bootstrap() {
|
|
47408
47338
|
const boot = window.__GGUI_DEV_PREVIEW__;
|
|
47409
47339
|
return {
|
|
@@ -47467,11 +47397,11 @@ function PreviewApp({
|
|
|
47467
47397
|
token,
|
|
47468
47398
|
selectedId
|
|
47469
47399
|
}) {
|
|
47470
|
-
const [state, setState] = (0,
|
|
47400
|
+
const [state, setState] = (0, import_react43.useState)(
|
|
47471
47401
|
selectedId ? { kind: "loading" } : { kind: "idle" }
|
|
47472
47402
|
);
|
|
47473
|
-
const [version2, setVersion] = (0,
|
|
47474
|
-
(0,
|
|
47403
|
+
const [version2, setVersion] = (0, import_react43.useState)(0);
|
|
47404
|
+
(0, import_react43.useEffect)(() => {
|
|
47475
47405
|
if (!selectedId) {
|
|
47476
47406
|
setState({ kind: "idle" });
|
|
47477
47407
|
return;
|
|
@@ -47484,7 +47414,7 @@ function PreviewApp({
|
|
|
47484
47414
|
});
|
|
47485
47415
|
return () => controller.abort();
|
|
47486
47416
|
}, [selectedId, token, version2]);
|
|
47487
|
-
(0,
|
|
47417
|
+
(0, import_react43.useEffect)(() => {
|
|
47488
47418
|
if (!selectedId) return;
|
|
47489
47419
|
const controller = new AbortController();
|
|
47490
47420
|
subscribeToRegistry(token, controller.signal, (event) => {
|
|
@@ -47494,90 +47424,90 @@ function PreviewApp({
|
|
|
47494
47424
|
return () => controller.abort();
|
|
47495
47425
|
}, [selectedId, token]);
|
|
47496
47426
|
if (state.kind === "idle") {
|
|
47497
|
-
return /* @__PURE__ */ (0,
|
|
47498
|
-
/* @__PURE__ */ (0,
|
|
47499
|
-
/* @__PURE__ */ (0,
|
|
47427
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47428
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "No UI selected" }),
|
|
47429
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: "Pick a UI from the Discovered UIs panel to preview it here." })
|
|
47500
47430
|
] });
|
|
47501
47431
|
}
|
|
47502
47432
|
if (state.kind === "loading") {
|
|
47503
|
-
return /* @__PURE__ */ (0,
|
|
47504
|
-
/* @__PURE__ */ (0,
|
|
47433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47434
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Meta, { children: [
|
|
47505
47435
|
"Preview of ",
|
|
47506
|
-
/* @__PURE__ */ (0,
|
|
47436
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: selectedId })
|
|
47507
47437
|
] }),
|
|
47508
|
-
/* @__PURE__ */ (0,
|
|
47438
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: "Loading bundle\u2026" })
|
|
47509
47439
|
] });
|
|
47510
47440
|
}
|
|
47511
47441
|
if (state.kind === "ready") {
|
|
47512
|
-
return /* @__PURE__ */ (0,
|
|
47442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "surface", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(DynamicComponent, { code: state.code }) });
|
|
47513
47443
|
}
|
|
47514
47444
|
if (state.kind === "not-found") {
|
|
47515
|
-
return /* @__PURE__ */ (0,
|
|
47516
|
-
/* @__PURE__ */ (0,
|
|
47445
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47446
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Meta, { children: [
|
|
47517
47447
|
"Preview of ",
|
|
47518
|
-
/* @__PURE__ */ (0,
|
|
47448
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: selectedId })
|
|
47519
47449
|
] }),
|
|
47520
|
-
/* @__PURE__ */ (0,
|
|
47450
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: "The server doesn't know this id. It may have been removed from the registry." })
|
|
47521
47451
|
] });
|
|
47522
47452
|
}
|
|
47523
47453
|
if (state.kind === "missing") {
|
|
47524
|
-
return /* @__PURE__ */ (0,
|
|
47525
|
-
/* @__PURE__ */ (0,
|
|
47526
|
-
/* @__PURE__ */ (0,
|
|
47454
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47455
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "No renderable entry" }),
|
|
47456
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Status, { children: [
|
|
47527
47457
|
"Declare ",
|
|
47528
|
-
/* @__PURE__ */ (0,
|
|
47458
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "entryPoint" }),
|
|
47529
47459
|
" in ",
|
|
47530
|
-
/* @__PURE__ */ (0,
|
|
47460
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "ggui.ui.json" }),
|
|
47531
47461
|
", or colocate a ",
|
|
47532
|
-
/* @__PURE__ */ (0,
|
|
47462
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "ggui.ui.tsx" }),
|
|
47533
47463
|
" beside the manifest."
|
|
47534
47464
|
] }),
|
|
47535
|
-
state.tried.length > 0 && /* @__PURE__ */ (0,
|
|
47465
|
+
state.tried.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "tried", children: state.tried.join("\n") })
|
|
47536
47466
|
] });
|
|
47537
47467
|
}
|
|
47538
47468
|
if (state.kind === "compile") {
|
|
47539
|
-
return /* @__PURE__ */ (0,
|
|
47540
|
-
/* @__PURE__ */ (0,
|
|
47541
|
-
/* @__PURE__ */ (0,
|
|
47469
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47470
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "Local compile failed" }),
|
|
47471
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("ul", { className: "errors", children: state.detail.errors.map((err, i) => {
|
|
47542
47472
|
const loc = err.location;
|
|
47543
47473
|
const locLine = loc ? `${loc.file ?? state.detail.entry}:${loc.line ?? "?"}:${loc.column ?? "?"}` : state.detail.entry;
|
|
47544
|
-
return /* @__PURE__ */ (0,
|
|
47545
|
-
/* @__PURE__ */ (0,
|
|
47546
|
-
/* @__PURE__ */ (0,
|
|
47547
|
-
loc?.lineText && /* @__PURE__ */ (0,
|
|
47474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("li", { children: [
|
|
47475
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "location", children: locLine }),
|
|
47476
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "error", children: err.text }),
|
|
47477
|
+
loc?.lineText && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("pre", { className: "line-text", children: loc.lineText })
|
|
47548
47478
|
] }, i);
|
|
47549
47479
|
}) })
|
|
47550
47480
|
] });
|
|
47551
47481
|
}
|
|
47552
47482
|
if (state.kind === "http") {
|
|
47553
|
-
return /* @__PURE__ */ (0,
|
|
47554
|
-
/* @__PURE__ */ (0,
|
|
47483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47484
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Meta, { children: [
|
|
47555
47485
|
"Bundle fetch failed (HTTP ",
|
|
47556
47486
|
state.status,
|
|
47557
47487
|
")"
|
|
47558
47488
|
] }),
|
|
47559
|
-
/* @__PURE__ */ (0,
|
|
47489
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Status, { children: state.message })
|
|
47560
47490
|
] });
|
|
47561
47491
|
}
|
|
47562
|
-
return /* @__PURE__ */ (0,
|
|
47563
|
-
/* @__PURE__ */ (0,
|
|
47564
|
-
/* @__PURE__ */ (0,
|
|
47492
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Pane, { children: [
|
|
47493
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(Meta, { children: "Local ggui dev server is unreachable" }),
|
|
47494
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Status, { children: [
|
|
47565
47495
|
"Studio could not reach the server \u2014 is ",
|
|
47566
|
-
/* @__PURE__ */ (0,
|
|
47496
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("code", { children: "ggui dev" }),
|
|
47567
47497
|
" still running?",
|
|
47568
|
-
/* @__PURE__ */ (0,
|
|
47569
|
-
/* @__PURE__ */ (0,
|
|
47498
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("br", {}),
|
|
47499
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)("span", { className: "dim", children: state.message })
|
|
47570
47500
|
] })
|
|
47571
47501
|
] });
|
|
47572
47502
|
}
|
|
47573
47503
|
function Pane({ children }) {
|
|
47574
|
-
return /* @__PURE__ */ (0,
|
|
47504
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "frame", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "pane", children }) });
|
|
47575
47505
|
}
|
|
47576
47506
|
function Meta({ children }) {
|
|
47577
|
-
return /* @__PURE__ */ (0,
|
|
47507
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "meta", children });
|
|
47578
47508
|
}
|
|
47579
47509
|
function Status({ children }) {
|
|
47580
|
-
return /* @__PURE__ */ (0,
|
|
47510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "status", children });
|
|
47581
47511
|
}
|
|
47582
47512
|
async function subscribeToRegistry(token, signal, onEvent) {
|
|
47583
47513
|
let backoff = 500;
|
|
@@ -47646,7 +47576,7 @@ function mount() {
|
|
|
47646
47576
|
if (!root) throw new Error("preview-root element not found in shell");
|
|
47647
47577
|
const { token, selectedId } = bootstrap();
|
|
47648
47578
|
(0, import_client.createRoot)(root).render(
|
|
47649
|
-
/* @__PURE__ */ (0,
|
|
47579
|
+
/* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_react43.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(PreviewApp, { token, selectedId }) })
|
|
47650
47580
|
);
|
|
47651
47581
|
}
|
|
47652
47582
|
mount();
|