@codeandfunction/callaloo 1.3.3 → 1.3.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.
@@ -1318,97 +1318,55 @@
1318
1318
  });
1319
1319
 
1320
1320
  const prefix$g = "clll-heading";
1321
- const _sfc_main$l = /* @__PURE__ */ vue.defineComponent({
1322
- ...{
1323
- inheritAttrs: false
1324
- },
1325
- __name: "Heading",
1321
+ const _sfc_main$l = {
1326
1322
  props: {
1327
- type: { default: HeadingTypes.Title },
1328
- theme: { default: Themes.Dark },
1329
- align: { default: Align.Left },
1330
- level: {}
1323
+ type: {
1324
+ type: String,
1325
+ default: HeadingTypes.Title,
1326
+ required: true
1327
+ },
1328
+ theme: {
1329
+ type: String,
1330
+ default: Themes.Dark
1331
+ },
1332
+ align: {
1333
+ type: String,
1334
+ default: Align.Left
1335
+ },
1336
+ level: {
1337
+ type: String
1338
+ }
1331
1339
  },
1332
- setup(__props) {
1333
- const props = __props;
1334
- const getClass = () => {
1335
- return [
1336
- prefix$g,
1337
- `${prefix$g}--${props.type}`,
1338
- `${prefix$g}--${props.theme}`,
1339
- `${prefix$g}--${props.align}`
1340
- ];
1341
- };
1342
- return (_ctx, _cache) => {
1343
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
1344
- !_ctx.level ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
1345
- _ctx.type === vue.unref(HeadingTypes).PageTitle ? (vue.openBlock(), vue.createElementBlock("h1", {
1346
- key: 0,
1347
- class: vue.normalizeClass(getClass())
1348
- }, [
1349
- vue.renderSlot(_ctx.$slots, "default")
1350
- ], 2)) : vue.createCommentVNode("", true),
1351
- _ctx.type === vue.unref(HeadingTypes).Title ? (vue.openBlock(), vue.createElementBlock("h1", {
1352
- key: 1,
1353
- class: vue.normalizeClass(getClass())
1354
- }, [
1355
- vue.renderSlot(_ctx.$slots, "default")
1356
- ], 2)) : vue.createCommentVNode("", true),
1357
- _ctx.type === vue.unref(HeadingTypes).Section ? (vue.openBlock(), vue.createElementBlock("h2", {
1358
- key: 2,
1359
- class: vue.normalizeClass(getClass())
1360
- }, [
1361
- vue.renderSlot(_ctx.$slots, "default")
1362
- ], 2)) : vue.createCommentVNode("", true),
1363
- _ctx.type === vue.unref(HeadingTypes).SubSection ? (vue.openBlock(), vue.createElementBlock("h3", {
1364
- key: 3,
1365
- class: vue.normalizeClass(getClass())
1366
- }, [
1367
- vue.renderSlot(_ctx.$slots, "default")
1368
- ], 2)) : vue.createCommentVNode("", true)
1369
- ], 64)) : vue.createCommentVNode("", true),
1370
- _ctx.level ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 1 }, [
1371
- _ctx.level === vue.unref(HeadingLevels).H1 ? (vue.openBlock(), vue.createElementBlock("h1", {
1372
- key: 0,
1373
- class: vue.normalizeClass(getClass())
1374
- }, [
1375
- vue.renderSlot(_ctx.$slots, "default")
1376
- ], 2)) : vue.createCommentVNode("", true),
1377
- _ctx.level === vue.unref(HeadingLevels).H2 ? (vue.openBlock(), vue.createElementBlock("h2", {
1378
- key: 1,
1379
- class: vue.normalizeClass(getClass())
1380
- }, [
1381
- vue.renderSlot(_ctx.$slots, "default")
1382
- ], 2)) : vue.createCommentVNode("", true),
1383
- _ctx.level === vue.unref(HeadingLevels).H3 ? (vue.openBlock(), vue.createElementBlock("h3", {
1384
- key: 2,
1385
- class: vue.normalizeClass(getClass())
1386
- }, [
1387
- vue.renderSlot(_ctx.$slots, "default")
1388
- ], 2)) : vue.createCommentVNode("", true),
1389
- _ctx.level === vue.unref(HeadingLevels).H4 ? (vue.openBlock(), vue.createElementBlock("h4", {
1390
- key: 3,
1391
- class: vue.normalizeClass(getClass())
1392
- }, [
1393
- vue.renderSlot(_ctx.$slots, "default")
1394
- ], 2)) : vue.createCommentVNode("", true),
1395
- _ctx.level === vue.unref(HeadingLevels).H5 ? (vue.openBlock(), vue.createElementBlock("h5", {
1396
- key: 4,
1397
- class: vue.normalizeClass(getClass())
1398
- }, [
1399
- vue.renderSlot(_ctx.$slots, "default")
1400
- ], 2)) : vue.createCommentVNode("", true),
1401
- _ctx.level === vue.unref(HeadingLevels).H6 ? (vue.openBlock(), vue.createElementBlock("h6", {
1402
- key: 5,
1403
- class: vue.normalizeClass(getClass())
1404
- }, [
1405
- vue.renderSlot(_ctx.$slots, "default")
1406
- ], 2)) : vue.createCommentVNode("", true)
1407
- ], 64)) : vue.createCommentVNode("", true)
1408
- ], 64);
1340
+ setup(props, { slots }) {
1341
+ const getLevel = () => {
1342
+ if (props.level) return props.level;
1343
+ switch (props.type) {
1344
+ case HeadingTypes.Section:
1345
+ return HeadingLevels.H2;
1346
+ case HeadingTypes.SubSection:
1347
+ return HeadingLevels.H3;
1348
+ case HeadingTypes.PageTitle:
1349
+ case HeadingTypes.Title:
1350
+ default:
1351
+ return HeadingLevels.H1;
1352
+ }
1409
1353
  };
1354
+ return () => vue.h(
1355
+ getLevel(),
1356
+ {
1357
+ class: [
1358
+ prefix$g,
1359
+ `${prefix$g}--${props.type}`,
1360
+ `${prefix$g}--${props.theme}`,
1361
+ `${prefix$g}--${props.align}`
1362
+ ]
1363
+ },
1364
+ {
1365
+ default: () => slots?.["default"] && slots?.["default"]()
1366
+ }
1367
+ );
1410
1368
  }
1411
- });
1369
+ };
1412
1370
 
1413
1371
  const matchIconName = /^[a-z0-9]+(-[a-z0-9]+)*$/;
1414
1372
  const stringToIcon = (value, validate, allowSimpleName, provider = "") => {
@@ -4394,35 +4352,47 @@
4394
4352
  });
4395
4353
 
4396
4354
  const prefix$1 = "clll-text";
4397
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
4398
- __name: "Text",
4355
+ const _sfc_main$2 = {
4399
4356
  props: {
4400
- type: { default: TextTypes.Body },
4401
- theme: { default: Themes.Dark },
4402
- truncate: { type: Boolean, default: false },
4403
- label: { type: Boolean, default: false },
4404
- as: { default: "p" }
4357
+ type: {
4358
+ type: String,
4359
+ default: TextTypes.Body
4360
+ },
4361
+ theme: {
4362
+ type: String,
4363
+ default: Themes.Dark
4364
+ },
4365
+ truncate: {
4366
+ type: Boolean,
4367
+ default: false
4368
+ },
4369
+ label: {
4370
+ type: Boolean,
4371
+ default: false
4372
+ },
4373
+ as: {
4374
+ type: String,
4375
+ default: "p"
4376
+ }
4405
4377
  },
4406
- setup(__props) {
4407
- return (_ctx, _cache) => {
4408
- const _component_as = vue.resolveComponent("as");
4409
- return vue.openBlock(), vue.createBlock(_component_as, {
4410
- class: vue.normalizeClass([
4378
+ setup(props, { slots }) {
4379
+ return () => vue.h(
4380
+ props.as,
4381
+ {
4382
+ class: [
4411
4383
  prefix$1,
4412
- `${prefix$1}--${_ctx.type}`,
4413
- `${prefix$1}--${_ctx.theme}`,
4414
- `${prefix$1}--${_ctx.truncate ? "wrap" : "nowrap"}`,
4415
- _ctx.label ? `${prefix$1}--label` : ""
4416
- ])
4417
- }, {
4418
- default: vue.withCtx(() => [
4419
- vue.renderSlot(_ctx.$slots, "default")
4420
- ]),
4421
- _: 3
4422
- }, 8, ["class"]);
4423
- };
4384
+ `${prefix$1}--${props.type}`,
4385
+ `${prefix$1}--${props.theme}`,
4386
+ `${prefix$1}--${props.truncate ? "wrap" : "nowrap"}`,
4387
+ props.label ? `${prefix$1}--label` : ""
4388
+ ]
4389
+ },
4390
+ {
4391
+ default: () => slots?.["default"] && slots?.["default"]()
4392
+ }
4393
+ );
4424
4394
  }
4425
- });
4395
+ };
4426
4396
 
4427
4397
  const _hoisted_1 = ["for"];
4428
4398
  const _hoisted_2 = ["id", "name", "aria-label", "autocomplete", "disabled", "form", "maxlength", "minlength", "pattern", "placeholder", "readonly", "required", "spellcheck", "rows", "value"];
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "name": "Anthony Cholmondeley",
6
6
  "url": "https://callaloo.codeandfunction.com"
7
7
  },
8
- "version": "1.3.3",
8
+ "version": "1.3.4",
9
9
  "license": "MIT",
10
10
  "type": "module",
11
11
  "scripts": {