@guardian/interactive-component-library 0.2.0-rc1 → 0.2.0-rc2
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/_virtual/_commonjsHelpers.js +8 -0
- package/dist/_virtual/dayjs.min.js +4 -0
- package/dist/_virtual/relativeTime.js +4 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/molecules/canvas-map/Map.d.ts +17 -0
- package/dist/components/molecules/canvas-map/Map.js +89 -0
- package/dist/components/molecules/canvas-map/context/MapContext.d.ts +19 -0
- package/dist/components/molecules/canvas-map/context/MapContext.js +20 -0
- package/dist/components/molecules/canvas-map/controls/ZoomControl.d.ts +6 -0
- package/dist/components/molecules/canvas-map/controls/ZoomControl.js +40 -0
- package/dist/components/molecules/canvas-map/controls/icons/index.d.ts +3 -0
- package/dist/components/molecules/canvas-map/controls/icons/minus.d.ts +1 -0
- package/dist/components/molecules/canvas-map/controls/icons/minus.js +25 -0
- package/dist/components/molecules/canvas-map/controls/icons/plus.d.ts +1 -0
- package/dist/components/molecules/canvas-map/controls/icons/plus.js +25 -0
- package/dist/components/molecules/canvas-map/controls/icons/reset.d.ts +3 -0
- package/dist/components/molecules/canvas-map/controls/icons/reset.js +25 -0
- package/dist/components/molecules/canvas-map/controls/index.d.ts +1 -0
- package/dist/components/molecules/canvas-map/controls/style.module.css.js +11 -0
- package/dist/components/molecules/canvas-map/index.d.ts +12 -0
- package/dist/components/molecules/canvas-map/lib/Feature.d.ts +38 -0
- package/dist/components/molecules/canvas-map/lib/Feature.js +104 -0
- package/dist/components/molecules/canvas-map/lib/FeatureCollection.d.ts +20 -0
- package/dist/components/molecules/canvas-map/lib/FeatureCollection.js +23 -0
- package/dist/components/molecules/canvas-map/lib/Map.d.ts +69 -0
- package/dist/components/molecules/canvas-map/lib/Map.js +254 -0
- package/dist/components/molecules/canvas-map/lib/View.d.ts +136 -0
- package/dist/components/molecules/canvas-map/lib/View.js +179 -0
- package/dist/components/molecules/canvas-map/lib/events/Dispatcher.d.ts +8 -0
- package/dist/components/molecules/canvas-map/lib/events/Dispatcher.js +35 -0
- package/dist/components/molecules/canvas-map/lib/events/MapEvent.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/events/MapEvent.js +9 -0
- package/dist/components/molecules/canvas-map/lib/events/index.d.ts +2 -0
- package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/formats/GeoJSON.js +96 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Geometry.d.ts +32 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Geometry.js +41 -0
- package/dist/components/molecules/canvas-map/lib/geometry/LineString.d.ts +12 -0
- package/dist/components/molecules/canvas-map/lib/geometry/LineString.js +19 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Point.d.ts +11 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Point.js +16 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Polygon.d.ts +16 -0
- package/dist/components/molecules/canvas-map/lib/geometry/Polygon.js +46 -0
- package/dist/components/molecules/canvas-map/lib/geometry/index.d.ts +4 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/index.d.ts +2 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.d.ts +5 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateFeatures.js +95 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.d.ts +4 -0
- package/dist/components/molecules/canvas-map/lib/interpolators/interpolateStyles.js +65 -0
- package/dist/components/molecules/canvas-map/lib/layers/TextLayer.d.ts +52 -0
- package/dist/components/molecules/canvas-map/lib/layers/TextLayer.js +111 -0
- package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.d.ts +53 -0
- package/dist/components/molecules/canvas-map/lib/layers/VectorLayer.js +132 -0
- package/dist/components/molecules/canvas-map/lib/layers/index.d.ts +3 -0
- package/dist/components/molecules/canvas-map/lib/projection/index.d.ts +22 -0
- package/dist/components/molecules/canvas-map/lib/projection/index.js +12 -0
- package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/renderers/FeatureRenderer.js +46 -0
- package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/renderers/MapRenderer.js +53 -0
- package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.d.ts +17 -0
- package/dist/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.js +119 -0
- package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/renderers/VectorLayerRenderer.js +78 -0
- package/dist/components/molecules/canvas-map/lib/sources/VectorSource.d.ts +15 -0
- package/dist/components/molecules/canvas-map/lib/sources/VectorSource.js +56 -0
- package/dist/components/molecules/canvas-map/lib/styles/Fill.d.ts +7 -0
- package/dist/components/molecules/canvas-map/lib/styles/Fill.js +15 -0
- package/dist/components/molecules/canvas-map/lib/styles/Stroke.d.ts +8 -0
- package/dist/components/molecules/canvas-map/lib/styles/Stroke.js +16 -0
- package/dist/components/molecules/canvas-map/lib/styles/Style.d.ts +24 -0
- package/dist/components/molecules/canvas-map/lib/styles/Style.js +17 -0
- package/dist/components/molecules/canvas-map/lib/styles/Text.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/styles/Text.js +14 -0
- package/dist/components/molecules/canvas-map/lib/styles/index.d.ts +4 -0
- package/dist/components/molecules/canvas-map/lib/util/array.d.ts +6 -0
- package/dist/components/molecules/canvas-map/lib/util/array.js +15 -0
- package/dist/components/molecules/canvas-map/lib/util/bboxFeature.d.ts +8 -0
- package/dist/components/molecules/canvas-map/lib/util/bboxFeature.js +26 -0
- package/dist/components/molecules/canvas-map/lib/util/debug.d.ts +11 -0
- package/dist/components/molecules/canvas-map/lib/util/debug.js +27 -0
- package/dist/components/molecules/canvas-map/lib/util/deflate.d.ts +36 -0
- package/dist/components/molecules/canvas-map/lib/util/distance.d.ts +1 -0
- package/dist/components/molecules/canvas-map/lib/util/distance.js +12 -0
- package/dist/components/molecules/canvas-map/lib/util/dom.d.ts +9 -0
- package/dist/components/molecules/canvas-map/lib/util/dom.js +28 -0
- package/dist/components/molecules/canvas-map/lib/util/extent.d.ts +21 -0
- package/dist/components/molecules/canvas-map/lib/util/extent.js +38 -0
- package/dist/components/molecules/canvas-map/lib/util/memoise.d.ts +10 -0
- package/dist/components/molecules/canvas-map/lib/util/memoise.js +20 -0
- package/dist/components/molecules/canvas-map/lib/util/resolution.d.ts +9 -0
- package/dist/components/molecules/canvas-map/lib/util/resolution.js +11 -0
- package/dist/components/molecules/canvas-map/lib/util/simplify.d.ts +114 -0
- package/dist/components/molecules/canvas-map/lib/util/size.d.ts +32 -0
- package/dist/components/molecules/canvas-map/lib/util/size.js +53 -0
- package/dist/components/molecules/canvas-map/lib/util/toRgba.d.ts +1 -0
- package/dist/components/molecules/canvas-map/lib/util/toRgba.js +25 -0
- package/dist/components/molecules/canvas-map/lib/util/uid.d.ts +5 -0
- package/dist/components/molecules/canvas-map/lib/util/uid.js +7 -0
- package/dist/components/molecules/canvas-map/lib/util/zoomLevel.d.ts +2 -0
- package/dist/components/molecules/canvas-map/lib/util/zoomLevel.js +14 -0
- package/dist/components/molecules/canvas-map/style.module.scss.js +20 -0
- package/dist/components/molecules/column-chart/column-chart-example.d.ts +35 -0
- package/dist/components/molecules/column-chart/column-chart-util.d.ts +1 -0
- package/dist/components/molecules/column-chart/index.d.ts +11 -0
- package/dist/components/molecules/column-chart/index.js +63 -0
- package/dist/components/molecules/column-chart/style.module.css.js +14 -0
- package/dist/components/molecules/control-change/index.d.ts +6 -0
- package/dist/components/molecules/control-change/index.js +29 -0
- package/dist/components/molecules/control-change/style.module.css.js +11 -0
- package/dist/components/molecules/dropdown/index.d.ts +11 -0
- package/dist/components/molecules/dropdown/index.js +191 -0
- package/dist/components/molecules/dropdown/style.module.css.js +50 -0
- package/dist/components/molecules/first-past-the-post-waffle/index.d.ts +5 -0
- package/dist/components/molecules/first-past-the-post-waffle/index.js +14 -0
- package/dist/components/molecules/first-past-the-post-waffle/style.module.css.js +14 -0
- package/dist/components/molecules/index.d.ts +17 -0
- package/dist/components/molecules/modal/index.d.ts +8 -0
- package/dist/components/molecules/modal/index.js +59 -0
- package/dist/components/molecules/modal/style.module.css.js +26 -0
- package/dist/components/molecules/page-section/index.d.ts +8 -0
- package/dist/components/molecules/page-section/index.js +52 -0
- package/dist/components/molecules/page-section/style.module.scss.js +20 -0
- package/dist/components/molecules/party-profile/index.d.ts +10 -0
- package/dist/components/molecules/party-profile/index.js +29 -0
- package/dist/components/molecules/party-profile/style.module.css.js +26 -0
- package/dist/components/molecules/refresh-indicator/index.d.ts +4 -0
- package/dist/components/molecules/refresh-indicator/index.js +18 -0
- package/dist/components/molecules/refresh-indicator/style.module.scss.js +17 -0
- package/dist/components/molecules/responsive-grid/index.d.ts +10 -0
- package/dist/components/molecules/responsive-grid/index.js +19 -0
- package/dist/components/molecules/responsive-grid/style.module.scss.js +8 -0
- package/dist/components/molecules/result-summary/index.d.ts +8 -0
- package/dist/components/molecules/result-summary/index.js +36 -0
- package/dist/components/molecules/result-summary/style.module.css.js +11 -0
- package/dist/components/molecules/search-input/icons/search.d.ts +1 -0
- package/dist/components/molecules/search-input/icons/search.js +24 -0
- package/dist/components/molecules/search-input/icons/search.module.css.js +11 -0
- package/dist/components/molecules/search-input/index.d.ts +11 -0
- package/dist/components/molecules/search-input/index.js +164 -0
- package/dist/components/molecules/search-input/style.module.css.js +32 -0
- package/dist/components/molecules/slope-chart/index.d.ts +16 -0
- package/dist/components/molecules/slope-chart/index.js +139 -0
- package/dist/components/molecules/slope-chart/style.module.css.js +35 -0
- package/dist/components/molecules/svg-map/context/MapContext.d.ts +1 -0
- package/dist/components/molecules/svg-map/context/MapContext.js +5 -0
- package/dist/components/molecules/svg-map/context/SVGMapProvider.d.ts +10 -0
- package/dist/components/molecules/svg-map/context/SVGMapProvider.js +88 -0
- package/dist/components/molecules/svg-map/helpers/bboxFeature.d.ts +8 -0
- package/dist/components/molecules/svg-map/helpers/bboxFeature.js +26 -0
- package/dist/components/molecules/svg-map/helpers/dynamicPropValue.d.ts +1 -0
- package/dist/components/molecules/svg-map/helpers/dynamicPropValue.js +9 -0
- package/dist/components/molecules/svg-map/helpers/geoMath.d.ts +4 -0
- package/dist/components/molecules/svg-map/helpers/saveSVG.d.ts +1 -0
- package/dist/components/molecules/svg-map/hooks/useCamera.d.ts +0 -0
- package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.d.ts +4 -0
- package/dist/components/molecules/svg-map/hooks/useThrowIfNonLayerChildren.js +19 -0
- package/dist/components/molecules/svg-map/index.d.ts +38 -0
- package/dist/components/molecules/svg-map/index.js +120 -0
- package/dist/components/molecules/svg-map/layers/CompositionBorders.d.ts +3 -0
- package/dist/components/molecules/svg-map/layers/CompositionBorders.js +14 -0
- package/dist/components/molecules/svg-map/layers/Line.d.ts +7 -0
- package/dist/components/molecules/svg-map/layers/Line.js +48 -0
- package/dist/components/molecules/svg-map/layers/Point.d.ts +10 -0
- package/dist/components/molecules/svg-map/layers/Point.js +59 -0
- package/dist/components/molecules/svg-map/layers/Polygon.d.ts +9 -0
- package/dist/components/molecules/svg-map/layers/Polygon.js +75 -0
- package/dist/components/molecules/svg-map/layers/Prerendered.d.ts +3 -0
- package/dist/components/molecules/svg-map/layers/Prerendered.js +11 -0
- package/dist/components/molecules/svg-map/layers/compositionBorders.module.scss.js +8 -0
- package/dist/components/molecules/svg-map/layers/index.d.ts +5 -0
- package/dist/components/molecules/svg-map/layers/index.js +12 -0
- package/dist/components/molecules/svg-map/renderers/SVGRenderer.d.ts +3 -0
- package/dist/components/molecules/svg-map/renderers/SVGRenderer.js +32 -0
- package/dist/components/molecules/svg-map/style.module.css.js +11 -0
- package/dist/components/molecules/table/index.d.ts +7 -0
- package/dist/components/molecules/table/index.js +90 -0
- package/dist/components/molecules/table/style.module.scss.js +29 -0
- package/dist/components/molecules/table/useTable.d.ts +8 -0
- package/dist/components/molecules/table/useTable.js +128 -0
- package/dist/components/molecules/tooltip/index.d.ts +82 -0
- package/dist/components/molecules/tooltip/index.js +117 -0
- package/dist/components/molecules/tooltip/style.module.css.js +8 -0
- package/dist/components/molecules/topline-result/index.d.ts +3 -0
- package/dist/components/molecules/topline-result/index.js +61 -0
- package/dist/components/molecules/topline-result/style.module.scss.js +38 -0
- package/dist/components/organisms/coalitions-tracker/index.d.ts +16 -0
- package/dist/components/organisms/coalitions-tracker/index.js +151 -0
- package/dist/components/organisms/coalitions-tracker/style.module.scss.js +32 -0
- package/dist/components/organisms/index.d.ts +2 -0
- package/dist/components/organisms/ticker/gradient/index.d.ts +1 -0
- package/dist/components/organisms/ticker/gradient/index.js +35 -0
- package/dist/components/organisms/ticker/gradient/style.module.scss.js +14 -0
- package/dist/components/organisms/ticker/index.d.ts +5 -0
- package/dist/components/organisms/ticker/index.js +102 -0
- package/dist/components/organisms/ticker/style.module.scss.js +32 -0
- package/dist/components/particles/ad-slot/index.d.ts +40 -0
- package/dist/components/particles/ad-slot/index.js +34 -0
- package/dist/components/particles/ad-slot/style.module.css.js +11 -0
- package/dist/components/particles/arrow-button/index.d.ts +6 -0
- package/dist/components/particles/arrow-button/index.js +32 -0
- package/dist/components/particles/arrow-button/style.module.css.js +11 -0
- package/dist/components/particles/aspect-ratio-box/index.d.ts +4 -0
- package/dist/components/particles/aspect-ratio-box/index.js +15 -0
- package/dist/components/particles/aspect-ratio-box/style.module.css.js +6 -0
- package/dist/components/particles/button/index.d.ts +6 -0
- package/dist/components/particles/button/index.js +10 -0
- package/dist/components/particles/button/style.module.css.js +11 -0
- package/dist/components/particles/change-bar/index.d.ts +8 -0
- package/dist/components/particles/change-bar/index.js +27 -0
- package/dist/components/particles/change-bar/style.module.scss.js +14 -0
- package/dist/components/particles/chevron/index.d.ts +6 -0
- package/dist/components/particles/chevron/index.js +78 -0
- package/dist/components/particles/chevron/style.module.css.js +20 -0
- package/dist/components/particles/circle-icon/index.d.ts +6 -0
- package/dist/components/particles/circle-icon/index.js +32 -0
- package/dist/components/particles/circle-icon/style.module.css.js +14 -0
- package/dist/components/particles/close-button/index.d.ts +5 -0
- package/dist/components/particles/close-button/index.js +35 -0
- package/dist/components/particles/close-button/style.module.css.js +17 -0
- package/dist/components/particles/container/index.d.ts +5 -0
- package/dist/components/particles/container/index.js +13 -0
- package/dist/components/particles/container/style.module.scss.js +11 -0
- package/dist/components/particles/gradient-icon/index.d.ts +1 -0
- package/dist/components/particles/gradient-icon/index.js +46 -0
- package/dist/components/particles/gradient-icon/style.module.css.js +14 -0
- package/dist/components/particles/index.d.ts +18 -0
- package/dist/components/particles/info-button/index.d.ts +3 -0
- package/dist/components/particles/info-button/index.js +19 -0
- package/dist/components/particles/info-button/style.module.css.js +11 -0
- package/dist/components/particles/legend-item/index.d.ts +6 -0
- package/dist/components/particles/legend-item/index.js +26 -0
- package/dist/components/particles/legend-item/style.module.css.js +17 -0
- package/dist/components/particles/relative-time-sentence/index.d.ts +4 -0
- package/dist/components/particles/relative-time-sentence/index.js +14 -0
- package/dist/components/particles/relative-time-sentence/style.module.css.js +8 -0
- package/dist/components/particles/square-cut-corner-icon/index.d.ts +6 -0
- package/dist/components/particles/square-cut-corner-icon/index.js +56 -0
- package/dist/components/particles/square-cut-corner-icon/style.module.scss.js +17 -0
- package/dist/components/particles/square-icon/index.d.ts +5 -0
- package/dist/components/particles/square-icon/index.js +28 -0
- package/dist/components/particles/square-icon/style.module.scss.js +11 -0
- package/dist/components/particles/stacked-bar/index.d.ts +23 -0
- package/dist/components/particles/stacked-bar/index.js +140 -0
- package/dist/components/particles/stacked-bar/style.module.css.js +17 -0
- package/dist/components/particles/stacked-grid/index.d.ts +6 -0
- package/dist/components/particles/stacked-grid/index.js +35 -0
- package/dist/components/particles/stacked-grid/style.module.css.js +20 -0
- package/dist/components/particles/waffle/index.d.ts +14 -0
- package/dist/components/particles/waffle/index.js +76 -0
- package/dist/components/particles/waffle/style.module.css.js +11 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +128 -0
- package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/color.js +338 -0
- package/dist/node_modules/.pnpm/d3-color@3.1.0/node_modules/d3-color/src/define.js +13 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/albersUk.js +108 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/bounds.js +24 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/fit.js +18 -0
- package/dist/node_modules/.pnpm/d3-composite-projections@1.4.0/node_modules/d3-composite-projections/src/math.js +4 -0
- package/dist/node_modules/.pnpm/d3-dispatch@3.0.1/node_modules/d3-dispatch/src/dispatch.js +70 -0
- package/dist/node_modules/.pnpm/d3-ease@3.0.1/node_modules/d3-ease/src/cubic.js +6 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/color.js +24 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/constant.js +4 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/number.js +8 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/rgb.js +20 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/string.js +43 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/decompose.js +28 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/index.js +59 -0
- package/dist/node_modules/.pnpm/d3-interpolate@3.0.1/node_modules/d3-interpolate/src/transform/parse.js +18 -0
- package/dist/node_modules/.pnpm/d3-path@2.0.0/node_modules/d3-path/src/path.js +73 -0
- package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timeout.js +13 -0
- package/dist/node_modules/.pnpm/d3-timer@3.0.1/node_modules/d3-timer/src/timer.js +96 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/interrupt.js +21 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/index.js +5 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/interrupt.js +9 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/selection/transition.js +39 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attr.js +55 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/attrTween.js +42 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/delay.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/duration.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/ease.js +14 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/easeVarying.js +15 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/end.js +23 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/filter.js +16 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/index.js +68 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/interpolate.js +11 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/merge.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/on.js +23 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/remove.js +13 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/schedule.js +125 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/select.js +20 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selectAll.js +24 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/selection.js +8 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/style.js +47 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/styleTween.js +25 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/text.js +18 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/textTween.js +25 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/transition.js +22 -0
- package/dist/node_modules/.pnpm/d3-transition@3.0.1_d3-selection@3.0.0/node_modules/d3-transition/src/transition/tween.js +64 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/dayjs.min.js +282 -0
- package/dist/node_modules/.pnpm/dayjs@1.11.12/node_modules/dayjs/plugin/relativeTime.js +48 -0
- package/dist/node_modules/.pnpm/flatbush@4.4.0/node_modules/flatbush/index.js +339 -0
- package/dist/node_modules/.pnpm/flatqueue@2.0.3/node_modules/flatqueue/index.js +67 -0
- package/dist/node_modules/.pnpm/preact-merge-refs@1.0.2_preact@10.21.0/node_modules/preact-merge-refs/lib/preact-merge-refs.modern.js +10 -0
- package/dist/node_modules/.pnpm/preact-transitioning@1.4.1_preact@10.21.0/node_modules/preact-transitioning/lib/preact-transitioning.modern.js +63 -0
- package/dist/node_modules/.pnpm/quickselect@2.0.0/node_modules/quickselect/index.js +47 -0
- package/dist/node_modules/.pnpm/rbush-knn@4.0.0/node_modules/rbush-knn/index.js +42 -0
- package/dist/node_modules/.pnpm/rbush@4.0.0/node_modules/rbush/index.js +378 -0
- package/dist/node_modules/.pnpm/tinyqueue@2.0.3/node_modules/tinyqueue/index.js +65 -0
- package/dist/shared/colors/index.d.ts +2 -0
- package/dist/shared/helpers/createStore.d.ts +1 -0
- package/dist/shared/helpers/geometry.d.ts +3 -0
- package/dist/shared/helpers/geometry.js +16 -0
- package/dist/shared/helpers/geometry.test.d.ts +1 -0
- package/dist/shared/helpers/labelsUtil.d.ts +54 -0
- package/dist/shared/helpers/labelsUtil.js +58 -0
- package/dist/shared/helpers/labelsUtils.test.d.ts +1 -0
- package/dist/shared/helpers/shouldUpdate.d.ts +7 -0
- package/dist/shared/hooks/index.d.ts +3 -0
- package/dist/shared/hooks/useContainerSize.d.ts +1 -0
- package/dist/shared/hooks/useContainerSize.js +24 -0
- package/dist/shared/hooks/useTouchOrHover.d.ts +6 -0
- package/dist/shared/hooks/useTouchOrHover.js +95 -0
- package/dist/shared/hooks/useWindowSize.d.ts +4 -0
- package/dist/shared/hooks/useWindowSize.js +27 -0
- package/dist/style.css +74 -74
- package/dist/styles/helpers/mergeStyles.d.ts +1 -0
- package/dist/styles/helpers/mergeStyles.js +22 -0
- package/dist/styles/helpers/mergeStyles.test.d.ts +1 -0
- package/dist/styles/theme.config.d.ts +124 -0
- package/package.json +6 -9
- package/dist/interactive-component-library.js +0 -7993
- package/dist/interactive-component-library.js.map +0 -1
- package/dist/interactive-component-library.umd.cjs +0 -7989
- package/dist/interactive-component-library.umd.cjs.map +0 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const BASE_RESOLUTION = 156543.03392;
|
|
2
|
+
function zoomLevelToZoomScale(zoomLevel, initialResolution) {
|
|
3
|
+
const resolution = BASE_RESOLUTION / Math.pow(2, zoomLevel);
|
|
4
|
+
const zoomScale = initialResolution / resolution;
|
|
5
|
+
return zoomScale;
|
|
6
|
+
}
|
|
7
|
+
function zoomLevelForResolution(currentResolution) {
|
|
8
|
+
const zoomLevel = Math.log2(BASE_RESOLUTION / currentResolution);
|
|
9
|
+
return zoomLevel;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
zoomLevelForResolution,
|
|
13
|
+
zoomLevelToZoomScale
|
|
14
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const mapContainer = "_mapContainer_1ogf3_9";
|
|
2
|
+
const helpTextContainer = "_helpTextContainer_1ogf3_15";
|
|
3
|
+
const helpText = "_helpText_1ogf3_15";
|
|
4
|
+
const desktopHelpText = "_desktopHelpText_1ogf3_40";
|
|
5
|
+
const mobileHelpText = "_mobileHelpText_1ogf3_48";
|
|
6
|
+
const styles = {
|
|
7
|
+
mapContainer,
|
|
8
|
+
helpTextContainer,
|
|
9
|
+
helpText,
|
|
10
|
+
desktopHelpText,
|
|
11
|
+
mobileHelpText
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
styles as default,
|
|
15
|
+
desktopHelpText,
|
|
16
|
+
helpText,
|
|
17
|
+
helpTextContainer,
|
|
18
|
+
mapContainer,
|
|
19
|
+
mobileHelpText
|
|
20
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export namespace example {
|
|
2
|
+
namespace sop {
|
|
3
|
+
let numResults: string;
|
|
4
|
+
let numCouncils: string;
|
|
5
|
+
let parties: ({
|
|
6
|
+
paId: number;
|
|
7
|
+
name: string;
|
|
8
|
+
abbreviation: string;
|
|
9
|
+
totalCouncils: number;
|
|
10
|
+
changeInControl: number;
|
|
11
|
+
seatsWon: number;
|
|
12
|
+
netChangeInSeats: number;
|
|
13
|
+
heldCouncils: string[];
|
|
14
|
+
lostCouncils: string[];
|
|
15
|
+
gainedCouncils: string[];
|
|
16
|
+
totalGainedCouncils: number;
|
|
17
|
+
totalLostCouncils: number;
|
|
18
|
+
totalHeldCouncils: number;
|
|
19
|
+
} | {
|
|
20
|
+
name: string;
|
|
21
|
+
abbreviation: string;
|
|
22
|
+
totalCouncils: number;
|
|
23
|
+
changeInControl: number;
|
|
24
|
+
seatsWon: number;
|
|
25
|
+
netChangeInSeats: number;
|
|
26
|
+
heldCouncils: string[];
|
|
27
|
+
lostCouncils: string[];
|
|
28
|
+
gainedCouncils: string[];
|
|
29
|
+
totalGainedCouncils: number;
|
|
30
|
+
totalLostCouncils: number;
|
|
31
|
+
totalHeldCouncils: number;
|
|
32
|
+
paId?: undefined;
|
|
33
|
+
})[];
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function scaleLinear(domain: any, range: any): (x: any) => number;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function ColumnChart({ columns, maxValue, minValue, chartHeight, chartWidth, columnWidth, columnPadding, styles, }: {
|
|
2
|
+
columns: any;
|
|
3
|
+
maxValue: any;
|
|
4
|
+
minValue: any;
|
|
5
|
+
chartHeight: any;
|
|
6
|
+
chartWidth: any;
|
|
7
|
+
columnWidth: any;
|
|
8
|
+
columnPadding: any;
|
|
9
|
+
styles: any;
|
|
10
|
+
}): import("preact").JSX.Element;
|
|
11
|
+
export default ColumnChart;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsxs, jsx } from "preact/jsx-runtime";
|
|
2
|
+
import defaultStyles from "./style.module.css.js";
|
|
3
|
+
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
4
|
+
import { scaleLinear } from "d3-scale";
|
|
5
|
+
const ColumnChart = ({
|
|
6
|
+
columns,
|
|
7
|
+
maxValue,
|
|
8
|
+
minValue,
|
|
9
|
+
chartHeight,
|
|
10
|
+
chartWidth,
|
|
11
|
+
columnWidth,
|
|
12
|
+
columnPadding,
|
|
13
|
+
styles
|
|
14
|
+
}) => {
|
|
15
|
+
styles = mergeStyles(defaultStyles, styles);
|
|
16
|
+
const yScale = scaleLinear([maxValue, minValue], [0, chartHeight]);
|
|
17
|
+
const totalColumnWidth = Number(columnWidth) + Number(columnPadding.left) + Number(columnPadding.right);
|
|
18
|
+
let marginBottom = minValue < 0 ? 0 : 40;
|
|
19
|
+
return /* @__PURE__ */ jsxs("svg", { width: chartWidth, height: chartHeight + marginBottom, children: [
|
|
20
|
+
columns.map((column, index) => {
|
|
21
|
+
const getHeight = (input) => {
|
|
22
|
+
return yScale(0) - yScale(input);
|
|
23
|
+
};
|
|
24
|
+
return /* @__PURE__ */ jsxs("g", { children: [
|
|
25
|
+
/* @__PURE__ */ jsx(
|
|
26
|
+
"rect",
|
|
27
|
+
{
|
|
28
|
+
x: index * totalColumnWidth,
|
|
29
|
+
height: getHeight(Math.abs(column.value)),
|
|
30
|
+
width: columnWidth,
|
|
31
|
+
y: column.value > 0 ? yScale(column.value) : yScale(0),
|
|
32
|
+
fill: column.color,
|
|
33
|
+
className: `${styles.bar} fill-color--${column.id}`,
|
|
34
|
+
id: column.id
|
|
35
|
+
}
|
|
36
|
+
),
|
|
37
|
+
/* @__PURE__ */ jsx(
|
|
38
|
+
"text",
|
|
39
|
+
{
|
|
40
|
+
className: styles.text,
|
|
41
|
+
x: index * totalColumnWidth + 2,
|
|
42
|
+
y: column.value < 0 ? yScale(0) - 6 : yScale(0) + 20,
|
|
43
|
+
children: column.label
|
|
44
|
+
}
|
|
45
|
+
)
|
|
46
|
+
] }, index);
|
|
47
|
+
}),
|
|
48
|
+
/* @__PURE__ */ jsx(
|
|
49
|
+
"rect",
|
|
50
|
+
{
|
|
51
|
+
className: styles.axis,
|
|
52
|
+
x: 0,
|
|
53
|
+
y: yScale(0),
|
|
54
|
+
width: chartWidth,
|
|
55
|
+
height: 1
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
] });
|
|
59
|
+
};
|
|
60
|
+
export {
|
|
61
|
+
ColumnChart,
|
|
62
|
+
ColumnChart as default
|
|
63
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, jsx } from "preact/jsx-runtime";
|
|
2
|
+
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
3
|
+
import "preact/hooks";
|
|
4
|
+
import { GradientIcon } from "../../particles/gradient-icon/index.js";
|
|
5
|
+
import "../../particles/info-button/index.js";
|
|
6
|
+
import { CircleIcon } from "../../particles/circle-icon/index.js";
|
|
7
|
+
import "../../particles/relative-time-sentence/index.js";
|
|
8
|
+
import defaultStyles from "./style.module.css.js";
|
|
9
|
+
const ControlChange = ({ previous, next, text, styles }) => {
|
|
10
|
+
styles = mergeStyles({ ...defaultStyles }, styles);
|
|
11
|
+
let hasChanged = next !== previous;
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
13
|
+
hasChanged ? /* @__PURE__ */ jsx(
|
|
14
|
+
GradientIcon,
|
|
15
|
+
{
|
|
16
|
+
previous,
|
|
17
|
+
next,
|
|
18
|
+
styles: {
|
|
19
|
+
previous: styles.previous,
|
|
20
|
+
next: styles.next
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
) : /* @__PURE__ */ jsx(CircleIcon, { styles: { circle: `fill-color--${next}` } }),
|
|
24
|
+
/* @__PURE__ */ jsx("strong", { className: styles.text, children: text })
|
|
25
|
+
] });
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
ControlChange
|
|
29
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export function Dropdown({ title, hint, options, onSelect, multipleSelect, iconForSelectedIndexPaths, collapseOnSelect, expandByDefault, styles, }: {
|
|
2
|
+
title: any;
|
|
3
|
+
hint: any;
|
|
4
|
+
options: any;
|
|
5
|
+
onSelect: any;
|
|
6
|
+
multipleSelect?: boolean;
|
|
7
|
+
iconForSelectedIndexPaths: any;
|
|
8
|
+
collapseOnSelect?: boolean;
|
|
9
|
+
expandByDefault?: boolean;
|
|
10
|
+
styles: any;
|
|
11
|
+
}): import("preact").JSX.Element;
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "preact/jsx-runtime";
|
|
2
|
+
import { useMemo, useState, useCallback } from "preact/hooks";
|
|
3
|
+
import { Chevron } from "../../particles/chevron/index.js";
|
|
4
|
+
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
5
|
+
import "../../particles/info-button/index.js";
|
|
6
|
+
import "../../particles/relative-time-sentence/index.js";
|
|
7
|
+
import defaultStyles from "./style.module.css.js";
|
|
8
|
+
function Dropdown({
|
|
9
|
+
title,
|
|
10
|
+
hint,
|
|
11
|
+
options,
|
|
12
|
+
onSelect,
|
|
13
|
+
multipleSelect = false,
|
|
14
|
+
iconForSelectedIndexPaths,
|
|
15
|
+
collapseOnSelect = false,
|
|
16
|
+
expandByDefault = true,
|
|
17
|
+
styles
|
|
18
|
+
}) {
|
|
19
|
+
styles = mergeStyles(defaultStyles, styles);
|
|
20
|
+
const optionGroups = useMemo(() => {
|
|
21
|
+
const containsOptionGroups = "options" in options[0];
|
|
22
|
+
if (!containsOptionGroups) {
|
|
23
|
+
options.forEach((option, index) => {
|
|
24
|
+
option.index = index;
|
|
25
|
+
option.group = 0;
|
|
26
|
+
});
|
|
27
|
+
return [{ group: 0, options }];
|
|
28
|
+
}
|
|
29
|
+
for (const [groupIndex, group] of options.entries()) {
|
|
30
|
+
for (const [optionIndex, option] of group.options.entries()) {
|
|
31
|
+
option.group = groupIndex;
|
|
32
|
+
option.index = optionIndex;
|
|
33
|
+
}
|
|
34
|
+
group.index = groupIndex;
|
|
35
|
+
}
|
|
36
|
+
return options;
|
|
37
|
+
}, [options]);
|
|
38
|
+
const [expanded, setExpanded] = useState(expandByDefault);
|
|
39
|
+
const [selectedIndexPaths, setSelectedIndexPaths] = useState(
|
|
40
|
+
() => createInitialIndexPaths(optionGroups, multipleSelect)
|
|
41
|
+
);
|
|
42
|
+
const onOptionClick = useCallback(
|
|
43
|
+
(option, index) => {
|
|
44
|
+
const indexPath = [option.group, index];
|
|
45
|
+
if (multipleSelect) {
|
|
46
|
+
setSelectedIndexPaths((selectedIndexPaths2) => {
|
|
47
|
+
selectedIndexPaths2[option.group] = indexPath;
|
|
48
|
+
return [...selectedIndexPaths2];
|
|
49
|
+
});
|
|
50
|
+
} else {
|
|
51
|
+
setSelectedIndexPaths([indexPath]);
|
|
52
|
+
}
|
|
53
|
+
if (onSelect) onSelect(option, indexPath);
|
|
54
|
+
if (collapseOnSelect) setExpanded(false);
|
|
55
|
+
},
|
|
56
|
+
[onSelect, collapseOnSelect, multipleSelect]
|
|
57
|
+
);
|
|
58
|
+
const iconForSelectedOption = useMemo(() => {
|
|
59
|
+
if (multipleSelect && iconForSelectedIndexPaths) {
|
|
60
|
+
return iconForSelectedIndexPaths(selectedIndexPaths);
|
|
61
|
+
}
|
|
62
|
+
const firstSelectedIndexPath = selectedIndexPaths[0];
|
|
63
|
+
const selectedOption = optionGroups[firstSelectedIndexPath[0]].options[firstSelectedIndexPath[1]];
|
|
64
|
+
return selectedOption.icon;
|
|
65
|
+
}, [
|
|
66
|
+
optionGroups,
|
|
67
|
+
selectedIndexPaths,
|
|
68
|
+
iconForSelectedIndexPaths,
|
|
69
|
+
multipleSelect
|
|
70
|
+
]);
|
|
71
|
+
const selectedIndexForGroup = useCallback(
|
|
72
|
+
(groupIndex) => {
|
|
73
|
+
if (multipleSelect) {
|
|
74
|
+
return selectedIndexPaths[groupIndex][1];
|
|
75
|
+
} else if (selectedIndexPaths[0][0] === groupIndex) {
|
|
76
|
+
return selectedIndexPaths[0][1];
|
|
77
|
+
}
|
|
78
|
+
return -1;
|
|
79
|
+
},
|
|
80
|
+
[selectedIndexPaths, multipleSelect]
|
|
81
|
+
);
|
|
82
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.container, children: [
|
|
83
|
+
/* @__PURE__ */ jsxs(
|
|
84
|
+
"button",
|
|
85
|
+
{
|
|
86
|
+
className: styles.button,
|
|
87
|
+
onClick: () => setExpanded((current) => !current),
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsx("img", { src: iconForSelectedOption, className: styles.icon }),
|
|
90
|
+
/* @__PURE__ */ jsx("span", { className: styles.title, children: title }),
|
|
91
|
+
/* @__PURE__ */ jsx(
|
|
92
|
+
Chevron,
|
|
93
|
+
{
|
|
94
|
+
active: true,
|
|
95
|
+
size: "large",
|
|
96
|
+
direction: expanded ? "up" : "down"
|
|
97
|
+
}
|
|
98
|
+
)
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
),
|
|
102
|
+
/* @__PURE__ */ jsx("div", { className: styles.clearFix }),
|
|
103
|
+
/* @__PURE__ */ jsxs(
|
|
104
|
+
"div",
|
|
105
|
+
{
|
|
106
|
+
className: styles.popout,
|
|
107
|
+
style: { visibility: expanded ? "visible" : "hidden" },
|
|
108
|
+
children: [
|
|
109
|
+
hint && /* @__PURE__ */ jsx("p", { className: styles.hint, children: hint }),
|
|
110
|
+
optionGroups.map((group, index) => {
|
|
111
|
+
return /* @__PURE__ */ jsx(
|
|
112
|
+
OptionGroup,
|
|
113
|
+
{
|
|
114
|
+
...group,
|
|
115
|
+
selectedIndex: selectedIndexForGroup(index),
|
|
116
|
+
onOptionClick,
|
|
117
|
+
styles
|
|
118
|
+
},
|
|
119
|
+
index
|
|
120
|
+
);
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
function OptionGroup({
|
|
128
|
+
title,
|
|
129
|
+
className,
|
|
130
|
+
options,
|
|
131
|
+
selectedIndex,
|
|
132
|
+
onOptionClick,
|
|
133
|
+
styles
|
|
134
|
+
}) {
|
|
135
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
136
|
+
title && /* @__PURE__ */ jsx("span", { className: styles.groupHeader, children: title }),
|
|
137
|
+
options.map((option) => {
|
|
138
|
+
const isSelected = option.index === selectedIndex;
|
|
139
|
+
return /* @__PURE__ */ jsxs(
|
|
140
|
+
"button",
|
|
141
|
+
{
|
|
142
|
+
className: [
|
|
143
|
+
styles.option,
|
|
144
|
+
className,
|
|
145
|
+
isSelected ? styles.selected : ""
|
|
146
|
+
].join(" "),
|
|
147
|
+
onClick: () => onOptionClick(option, option.index),
|
|
148
|
+
children: [
|
|
149
|
+
/* @__PURE__ */ jsx("img", { src: option.icon, className: styles.optionIcon }),
|
|
150
|
+
/* @__PURE__ */ jsxs("div", { className: styles.optionText, children: [
|
|
151
|
+
/* @__PURE__ */ jsx("h4", { className: styles.optionTitle, children: option.title }),
|
|
152
|
+
/* @__PURE__ */ jsx("p", { className: styles.optionDescription, children: option.description })
|
|
153
|
+
] }),
|
|
154
|
+
isSelected && /* @__PURE__ */ jsx("div", { className: styles.checkmark, children: /* @__PURE__ */ jsx(Checkmark, {}) })
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
option.title
|
|
158
|
+
);
|
|
159
|
+
})
|
|
160
|
+
] });
|
|
161
|
+
}
|
|
162
|
+
function Checkmark() {
|
|
163
|
+
return /* @__PURE__ */ jsx(
|
|
164
|
+
"svg",
|
|
165
|
+
{
|
|
166
|
+
width: "11",
|
|
167
|
+
height: "9",
|
|
168
|
+
viewBox: "0 0 11 9",
|
|
169
|
+
fill: "none",
|
|
170
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
171
|
+
children: /* @__PURE__ */ jsx(
|
|
172
|
+
"path",
|
|
173
|
+
{
|
|
174
|
+
fillRule: "evenodd",
|
|
175
|
+
clipRule: "evenodd",
|
|
176
|
+
d: "M0.631814 4.43687L0.0839844 4.9847L2.82313 8.8195H3.08335L10.9173 0.711624L10.3695 0.17749L3.08335 6.77884L0.631814 4.43687Z",
|
|
177
|
+
className: defaultStyles.checkmarkPath
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
function createInitialIndexPaths(groups, multipleSelect) {
|
|
184
|
+
if (multipleSelect) {
|
|
185
|
+
return groups.map((group) => [group.index, 0]);
|
|
186
|
+
}
|
|
187
|
+
return [[0, 0]];
|
|
188
|
+
}
|
|
189
|
+
export {
|
|
190
|
+
Dropdown
|
|
191
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const container = "_container_6u92g_1";
|
|
2
|
+
const button = "_button_6u92g_5";
|
|
3
|
+
const icon = "_icon_6u92g_22";
|
|
4
|
+
const title = "_title_6u92g_27";
|
|
5
|
+
const clearFix = "_clearFix_6u92g_34";
|
|
6
|
+
const popout = "_popout_6u92g_38";
|
|
7
|
+
const hint = "_hint_6u92g_55";
|
|
8
|
+
const groupHeader = "_groupHeader_6u92g_62";
|
|
9
|
+
const option = "_option_6u92g_69";
|
|
10
|
+
const selected = "_selected_6u92g_85";
|
|
11
|
+
const optionIcon = "_optionIcon_6u92g_94";
|
|
12
|
+
const optionTitle = "_optionTitle_6u92g_99";
|
|
13
|
+
const optionDescription = "_optionDescription_6u92g_107";
|
|
14
|
+
const checkmark = "_checkmark_6u92g_114";
|
|
15
|
+
const checkmarkPath = "_checkmarkPath_6u92g_120";
|
|
16
|
+
const defaultStyles = {
|
|
17
|
+
container,
|
|
18
|
+
button,
|
|
19
|
+
icon,
|
|
20
|
+
title,
|
|
21
|
+
clearFix,
|
|
22
|
+
popout,
|
|
23
|
+
hint,
|
|
24
|
+
groupHeader,
|
|
25
|
+
option,
|
|
26
|
+
selected,
|
|
27
|
+
optionIcon,
|
|
28
|
+
optionTitle,
|
|
29
|
+
optionDescription,
|
|
30
|
+
checkmark,
|
|
31
|
+
checkmarkPath
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
button,
|
|
35
|
+
checkmark,
|
|
36
|
+
checkmarkPath,
|
|
37
|
+
clearFix,
|
|
38
|
+
container,
|
|
39
|
+
defaultStyles as default,
|
|
40
|
+
groupHeader,
|
|
41
|
+
hint,
|
|
42
|
+
icon,
|
|
43
|
+
option,
|
|
44
|
+
optionDescription,
|
|
45
|
+
optionIcon,
|
|
46
|
+
optionTitle,
|
|
47
|
+
popout,
|
|
48
|
+
selected,
|
|
49
|
+
title
|
|
50
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs, jsx } from "preact/jsx-runtime";
|
|
2
|
+
import defaultStyles from "./style.module.css.js";
|
|
3
|
+
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
4
|
+
const FirstPastThePostWaffle = ({ styles, children, lineOverHang }) => {
|
|
5
|
+
styles = mergeStyles(defaultStyles, styles);
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", { className: styles.wrapper, children: [
|
|
7
|
+
/* @__PURE__ */ jsx("p", { style: { height: lineOverHang + 20 }, className: styles.halfLineText, children: children.halfLineText }),
|
|
8
|
+
/* @__PURE__ */ jsx("div", { className: styles.line, children: " " }),
|
|
9
|
+
children.waffle
|
|
10
|
+
] });
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
FirstPastThePostWaffle
|
|
14
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const wrapper = "_wrapper_kh25l_1";
|
|
2
|
+
const line = "_line_kh25l_5";
|
|
3
|
+
const halfLineText = "_halfLineText_kh25l_15";
|
|
4
|
+
const defaultStyles = {
|
|
5
|
+
wrapper,
|
|
6
|
+
line,
|
|
7
|
+
halfLineText
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
defaultStyles as default,
|
|
11
|
+
halfLineText,
|
|
12
|
+
line,
|
|
13
|
+
wrapper
|
|
14
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './table';
|
|
2
|
+
export * from './slope-chart';
|
|
3
|
+
export * from './tooltip';
|
|
4
|
+
export * from './control-change';
|
|
5
|
+
export * from './first-past-the-post-waffle';
|
|
6
|
+
export * from './topline-result';
|
|
7
|
+
export * from './page-section';
|
|
8
|
+
export * from './column-chart';
|
|
9
|
+
export * from './party-profile';
|
|
10
|
+
export * from './result-summary';
|
|
11
|
+
export * from './search-input';
|
|
12
|
+
export * from './refresh-indicator';
|
|
13
|
+
export * from './responsive-grid';
|
|
14
|
+
export * from './modal';
|
|
15
|
+
export * from './dropdown';
|
|
16
|
+
export * from './svg-map';
|
|
17
|
+
export * from './canvas-map';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export function Modal({ visible, blurBackground, alwaysMounted, styles, children, onClickOutside, }: {
|
|
2
|
+
visible?: boolean;
|
|
3
|
+
blurBackground?: boolean;
|
|
4
|
+
alwaysMounted?: boolean;
|
|
5
|
+
styles: any;
|
|
6
|
+
children: any;
|
|
7
|
+
onClickOutside: any;
|
|
8
|
+
}): import("preact").JSX.Element;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx } from "preact/jsx-runtime";
|
|
2
|
+
import { useRef, useCallback, useEffect } from "preact/hooks";
|
|
3
|
+
import { CSSTransition as d } from "../../../node_modules/.pnpm/preact-transitioning@1.4.1_preact@10.21.0/node_modules/preact-transitioning/lib/preact-transitioning.modern.js";
|
|
4
|
+
import defaultStyles from "./style.module.css.js";
|
|
5
|
+
import { mergeStyles } from "../../../styles/helpers/mergeStyles.js";
|
|
6
|
+
function Modal({
|
|
7
|
+
visible = false,
|
|
8
|
+
blurBackground = true,
|
|
9
|
+
alwaysMounted = false,
|
|
10
|
+
styles,
|
|
11
|
+
children,
|
|
12
|
+
onClickOutside
|
|
13
|
+
}) {
|
|
14
|
+
styles = mergeStyles(defaultStyles, styles);
|
|
15
|
+
const modalBoxRef = useRef();
|
|
16
|
+
const onClick = useCallback(
|
|
17
|
+
(event) => {
|
|
18
|
+
if (!modalBoxRef.current.contains(event.target)) {
|
|
19
|
+
if (onClickOutside && visible) onClickOutside(event);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
[onClickOutside, visible]
|
|
23
|
+
);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (visible) {
|
|
26
|
+
window.addEventListener("scroll", onClick, { once: true });
|
|
27
|
+
}
|
|
28
|
+
return () => {
|
|
29
|
+
if (visible) {
|
|
30
|
+
window.removeEventListener("scroll", onClick);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, [onClick, visible]);
|
|
34
|
+
if (typeof document === "undefined") return;
|
|
35
|
+
return /* @__PURE__ */ jsx(
|
|
36
|
+
d,
|
|
37
|
+
{
|
|
38
|
+
in: visible,
|
|
39
|
+
duration: 300,
|
|
40
|
+
classNames: styles,
|
|
41
|
+
alwaysMounted,
|
|
42
|
+
children: /* @__PURE__ */ jsx(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
className: [
|
|
46
|
+
styles.transitionContainer,
|
|
47
|
+
blurBackground && styles.blur,
|
|
48
|
+
visible && styles.visible
|
|
49
|
+
].join(" "),
|
|
50
|
+
onClick,
|
|
51
|
+
children: /* @__PURE__ */ jsx("div", { ref: modalBoxRef, className: styles.modalBox, children })
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
Modal
|
|
59
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const transitionContainer = "_transitionContainer_11twd_1";
|
|
2
|
+
const blur = "_blur_11twd_11";
|
|
3
|
+
const modalBox = "_modalBox_11twd_16";
|
|
4
|
+
const enter = "_enter_11twd_25";
|
|
5
|
+
const exitDone = "_exitDone_11twd_26";
|
|
6
|
+
const enterActive = "_enterActive_11twd_37";
|
|
7
|
+
const exit = "_exit_11twd_26";
|
|
8
|
+
const defaultStyles = {
|
|
9
|
+
transitionContainer,
|
|
10
|
+
blur,
|
|
11
|
+
modalBox,
|
|
12
|
+
enter,
|
|
13
|
+
exitDone,
|
|
14
|
+
enterActive,
|
|
15
|
+
exit
|
|
16
|
+
};
|
|
17
|
+
export {
|
|
18
|
+
blur,
|
|
19
|
+
defaultStyles as default,
|
|
20
|
+
enter,
|
|
21
|
+
enterActive,
|
|
22
|
+
exit,
|
|
23
|
+
exitDone,
|
|
24
|
+
modalBox,
|
|
25
|
+
transitionContainer
|
|
26
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export namespace SectionLayout {
|
|
2
|
+
let _default: string;
|
|
3
|
+
export { _default as default };
|
|
4
|
+
export let fullWidth: string;
|
|
5
|
+
}
|
|
6
|
+
export const PageSection: import('preact').FunctionalComponent<import('preact/compat').PropsWithoutRef<{}> & {
|
|
7
|
+
ref?: import('preact').Ref<any>;
|
|
8
|
+
}>;
|