no-frills-ui 0.0.14-rc.3 → 0.0.14-rc.4

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/index.js CHANGED
@@ -252,23 +252,23 @@ const getThemeValue = (key)=>{
252
252
  };
253
253
 
254
254
  const Ellipsis = /*#__PURE__*/ styled("span", {
255
- target: "eot8j4m0",
255
+ target: "e10k0igo0",
256
256
  label: "Ellipsis"
257
257
  })("white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:1;");
258
258
  const Header$1 = /*#__PURE__*/ styled("div", {
259
- target: "eot8j4m1",
259
+ target: "e10k0igo1",
260
260
  label: "Header"
261
261
  })("padding:10px 15px;line-height:26px;border-bottom:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";font-size:16px;font-weight:bold;");
262
262
  const Body$1 = /*#__PURE__*/ styled("div", {
263
- target: "eot8j4m2",
263
+ target: "e10k0igo2",
264
264
  label: "Body"
265
- })("padding:0 15px;margin:20px 0;flex:1;overflow:visible;");
265
+ })("padding:0 15px;margin:20px 0;flex:1;overflow:visible;display:flow-root;");
266
266
  const Footer$1 = /*#__PURE__*/ styled("div", {
267
- target: "eot8j4m3",
267
+ target: "e10k0igo3",
268
268
  label: "Footer"
269
269
  })("padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";display:flex;justify-content:flex-end;");
270
270
  const ErrorContainer$7 = /*#__PURE__*/ styled("div", {
271
- target: "eot8j4m4",
271
+ target: "e10k0igo4",
272
272
  label: "ErrorContainer"
273
273
  })("color:", getThemeValue(THEME_NAME.ERROR), ";padding-top:3px;font-size:12px;line-height:14px;");
274
274
 
@@ -310,9 +310,9 @@ const BadgeSpan = /*#__PURE__*/ styled("span", {
310
310
  const Badge = /*#__PURE__*/ React.forwardRef(BadgeComponent);
311
311
 
312
312
  const StyledCard = /*#__PURE__*/ styled("div", {
313
- target: "e9lfq9w0",
313
+ target: "e7s3yg90",
314
314
  label: "StyledCard"
315
- })("border-radius:10px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";", (props)=>props.elevated ? `box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};` : `box-shadow: ${getThemeValue(THEME_NAME.SHADOW)};`, " margin:5px;overflow:auto;position:relative;");
315
+ })("border-radius:10px;background-color:", getThemeValue(THEME_NAME.BACKGROUND), ";", (props)=>props.elevated ? `box-shadow: ${getThemeValue(THEME_NAME.MODAL_SHADOW)};` : `box-shadow: ${getThemeValue(THEME_NAME.SHADOW)};`, " margin:5px;overflow:visible;display:flow-root;position:relative;");
316
316
  /**
317
317
  * Card Component
318
318
  * @param props - Component props
@@ -326,35 +326,35 @@ const StyledCard = /*#__PURE__*/ styled("div", {
326
326
  const Card = /*#__PURE__*/ React.forwardRef(CardComponent);
327
327
 
328
328
  const Step$1 = /*#__PURE__*/ styled(Card, {
329
- target: "ex87x7i0",
329
+ target: "e1vu5oed0",
330
330
  label: "Step"
331
- })("transition:all 0.6s ease;overflow:visible;", (props)=>props.open && `margin: 20px 5px;`);
331
+ })("transition:all 0.6s ease;overflow:visible;display:flow-root;", (props)=>props.open && `margin: 20px 5px;`);
332
332
  const StepHeader = /*#__PURE__*/ styled("button", {
333
- target: "ex87x7i1",
333
+ target: "e1vu5oed1",
334
334
  label: "StepHeader"
335
335
  })("padding:20px 15px;display:flex;justify-content:space-between;background:none;border:none;border-radius:10px;width:100%;font-size:inherit;color:", getThemeValue(THEME_NAME.TEXT_COLOR_DARK), ";&:focus-visible{box-shadow:0 0 0 4px ", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";}& input{appearance:none;margin:0;}", (props)=>props.open && `border-bottom: 1px solid ${getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR)};`, " ", (props)=>props.open && `border-radius: 10px 10px 0 0;`, " ", (props)=>props.disabled && `color: ${getThemeValue(THEME_NAME.DISABLED)};`);
336
336
  const HeaderContainer = /*#__PURE__*/ styled("div", {
337
- target: "ex87x7i2",
337
+ target: "e1vu5oed2",
338
338
  label: "HeaderContainer"
339
339
  })("display:flex;align-items:center;min-width:40px;& svg{vertical-align:top;margin-right:10px;fill:", (props)=>props.open ? getThemeValue(THEME_NAME.PRIMARY) : props.completed ? getThemeValue(THEME_NAME.SUCCESS) : getThemeValue(THEME_NAME.LIGHT_GREY), ";transform:", (props)=>props.open ? 'scale(0.8)' : 'scale(0.6)', ";transition:all 0.3s ease;min-width:24px;}");
340
340
  const ExpandContainer = /*#__PURE__*/ styled("div", {
341
- target: "ex87x7i3",
341
+ target: "e1vu5oed3",
342
342
  label: "ExpandContainer"
343
343
  })("display:flex;align-items:center;& svg{vertical-align:top;margin-right:10px;transition:all 0.6s ease;fill:currentColor;}", (props)=>props.open ? `& svg { transform: rotate(180deg); }` : '');
344
344
  const StepBody = /*#__PURE__*/ styled("div", {
345
- target: "ex87x7i4",
345
+ target: "e1vu5oed4",
346
346
  label: "StepBody"
347
347
  })("transition:all 0.6s ease;overflow:hidden;height:", (props)=>props.height || 0, "px;");
348
348
  const AccordionBadge = /*#__PURE__*/ styled(Badge, {
349
- target: "ex87x7i5",
349
+ target: "e1vu5oed5",
350
350
  label: "AccordionBadge"
351
351
  })("margin-right:15px;");
352
352
  const AccordionStepBody = /*#__PURE__*/ styled("div", {
353
- target: "ex87x7i6",
353
+ target: "e1vu5oed6",
354
354
  label: "AccordionStepBody"
355
355
  })("padding:20px 15px;");
356
356
  const AccordionStepFooter = /*#__PURE__*/ styled("div", {
357
- target: "ex87x7i7",
357
+ target: "e1vu5oed7",
358
358
  label: "AccordionStepFooter"
359
359
  })("display:flex;justify-content:flex-end;padding:10px 15px;border-top:1px solid ", getThemeValue(THEME_NAME.BORDER_LIGHT_COLOR), ";");
360
360
  /**
@@ -3185,9 +3185,9 @@ Drawer.defaultProps = {
3185
3185
  };
3186
3186
 
3187
3187
  const Container$3 = /*#__PURE__*/ styled("div", {
3188
- target: "e1m58trk0",
3188
+ target: "e1t79jfh0",
3189
3189
  label: "Container"
3190
- })("display:inline-flex;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:3px;margin:5px;& button,& label{margin:0;border:none;border-radius:0;border-left:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";box-shadow:none;height:32px;}& > div button{border-left:none;}& input,& select{border:none;height:32px;}& input,& select{border-radius:0;}& input:active,& select:active{box-shadow:none;}& > div > span{top:8px;}& > *:first-of-type,& > label:first-of-type input,& > label:first-of-type select,& > *:first-of-type label,& > *:first-of-type input{border-left:none;border-radius:2px 0 0 2px;}& > *:last-child,& > label:last-child input,& > label:last-child select,& > *:last-child label,& > *:last-child input{border-radius:0 2px 2px 0;}& *:focus,& *:focus + span{z-index:1;}&:focus-within,&:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}", (props)=>props.errorText ? `
3190
+ })("display:inline-flex;border:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";border-radius:3px;margin:5px;& button,& label{margin:0;border:none;border-radius:0;border-left:1px solid ", getThemeValue(THEME_NAME.BORDER_COLOR), ";box-shadow:none;height:32px;}& > div button{border-left:none;}& input,& select{border:none;height:32px;}& input,& select{border-radius:0;}& input:active,& select:active{box-shadow:none;}& > div > span{top:8px;}& > *:nth-child(1 of:not(style)),& > label:nth-child(1 of:not(style)) input,& > label:nth-child(1 of:not(style)) select,& > *:nth-child(1 of:not(style)) label,& > *:nth-child(1 of:not(style)) input{border-left:none;border-radius:2px 0 0 2px;}& > *:last-child,& > label:last-child input,& > label:last-child select,& > *:last-child label,& > *:last-child input{border-radius:0 2px 2px 0;}& *:focus,& *:focus + span{z-index:1;}&:focus-within,&:hover{box-shadow:", getThemeValue(THEME_NAME.HOVER_SHADOW), ";}", (props)=>props.errorText ? `
3191
3191
  border-color: ${getThemeValue(THEME_NAME.ERROR)};
3192
3192
 
3193
3193
  & > button, & > label {
@@ -3195,7 +3195,7 @@ const Container$3 = /*#__PURE__*/ styled("div", {
3195
3195
  }
3196
3196
  ` : '');
3197
3197
  const ErrorContainer = /*#__PURE__*/ styled("div", {
3198
- target: "e1m58trk1",
3198
+ target: "e1t79jfh1",
3199
3199
  label: "ErrorContainer"
3200
3200
  })("color:", getThemeValue(THEME_NAME.ERROR), ";margin-left:8px;font-size:12px;");
3201
3201
  /**
@@ -3807,11 +3807,15 @@ const DEFAULT_DURATION$1 = 5000;
3807
3807
  */ this.destroy = (position)=>{
3808
3808
  const container = this.containers.get(position);
3809
3809
  if (container) {
3810
- container.root.unmount();
3811
- if (document.body.contains(container.div)) {
3812
- document.body.removeChild(container.div);
3813
- }
3814
- this.containers.delete(position);
3810
+ // Defer unmount to avoid trying to synchronously unmount a root
3811
+ // while React is already rendering which can cause a race.
3812
+ setTimeout(()=>{
3813
+ container.root.unmount();
3814
+ if (document.body.contains(container.div)) {
3815
+ document.body.removeChild(container.div);
3816
+ }
3817
+ this.containers.delete(position);
3818
+ }, 0);
3815
3819
  }
3816
3820
  };
3817
3821
  }
@@ -4111,15 +4115,15 @@ const getBackgroundColor = (type)=>{
4111
4115
  }
4112
4116
  };
4113
4117
  const ToastContainer = /*#__PURE__*/ styled(Card, {
4114
- target: "e1bc14ug0",
4118
+ target: "eb8x2sp0",
4115
4119
  label: "ToastContainer"
4116
4120
  })("box-sizing:border-box;border-radius:3px;padding:12px;background-color:", (props)=>getBackgroundColor(props.type), ";color:", getThemeValue(THEME_NAME.TEXT_COLOR_LIGHT), ";margin:20px;font-size:14px;line-height:20px;transform:translateY(100%);transition:transform 0.3s ease;width:344px;display:flex;align-items:center;position:relative;& svg{width:20px;height:20px;fill:currentColor;}@media (max-width:480px){&{margin:0;width:100vw;border-radius:0;}}.nf-layer-enter &{transform:translateY(0%);}");
4117
4121
  const TextContainer = /*#__PURE__*/ styled("div", {
4118
- target: "e1bc14ug1",
4122
+ target: "eb8x2sp1",
4119
4123
  label: "TextContainer"
4120
4124
  })("flex:1;");
4121
4125
  const CloseContainer = /*#__PURE__*/ styled("button", {
4122
- target: "e1bc14ug2",
4126
+ target: "eb8x2sp2",
4123
4127
  label: "CloseContainer"
4124
4128
  })("background-color:transparent;color:", getThemeValue(THEME_NAME.PRIMARY_LIGHT), ";padding:6px 10px;border:none;border-radius:3px;text-transform:uppercase;cursor:pointer;&:focus{background-color:rgba(255,255,255,0.1);}");
4125
4129
  const DEFAULT_DURATION = 2000;
@@ -4181,7 +4185,9 @@ class Toast {
4181
4185
  })
4182
4186
  });
4183
4187
  const Component = this.toast[0];
4184
- this.root = client.createRoot(this.element);
4188
+ if (!this.root) {
4189
+ this.root = client.createRoot(this.element);
4190
+ }
4185
4191
  this.root.render(/*#__PURE__*/ jsxRuntime.jsx(Component, {}));
4186
4192
  this.timeout = setTimeout(()=>{
4187
4193
  this.remove();